Инструменты пользователя

Инструменты сайта


courses:programming:io_redirection

Команды перенаправления вывода

          ||       StdOut        ||       StdErr        || existing
  Syntax  || Terminal |   File   || Terminal |   File   ||   file
==========++==========+==========++==========+==========++===========
    >     ||    no    |   yes    ||   yes    |    no    || overwrite
    >>    ||    no    |   yes    ||   yes    |    no    ||  append
          ||          |          ||          |          ||
   2>     ||   yes    |    no    ||    no    |   yes    || overwrite
   2>>    ||   yes    |    no    ||    no    |   yes    ||  append
          ||          |          ||          |          ||
   &>     ||    no    |   yes    ||    no    |   yes    || overwrite
   &>>    ||    no    |   yes    ||    no    |   yes    ||  append
          ||          |          ||          |          ||
 | tee    ||   yes    |   yes    ||   yes    |    no    || overwrite
 | tee -a ||   yes    |   yes    ||   yes    |    no    ||  append
          ||          |          ||          |          ||
 n.e. (*) ||   yes    |    no    ||   yes    |   yes    || overwrite
 n.e. (*) ||   yes    |    no    ||   yes    |   yes    ||  append
          ||          |          ||          |          ||
|& tee    ||   yes    |   yes    ||   yes    |   yes    || overwrite
|& tee -a ||   yes    |   yes    ||   yes    |   yes    ||  append