2021年12月28日星期二

Linux error output and command tee

echo test | grep test 2>&1

standard error output redirect to standard output to file.

ex.  find result show in screen and export to cmdlist file.

find /bin /usr/bin -type f | tee -a cmdlist 

$ tee --help

Usage: tee [OPTION]... [FILE]...

Copy standard input to each FILE, and also to standard output.


  -a, --append              append to the given FILEs, do not overwrite

  -i, --ignore-interrupts   ignore interrupt signals

      --help     display this help and exit

      --version  output version information and exit


If a FILE is -, copy again to standard output.


GNU coreutils online help: <http://www.gnu.org/software/coreutils/>

For complete documentation, run: info coreutils 'tee invocation'

没有评论: