tee
-
info
-
redirectdata to a file -
and provide a
copyof redirect data asstdinfor next set of commands -
read from
stdinonly
-
-
demo
-
create 2 files
$ echo a1 > a1.txt $ echo a2 > a2.txt -
write a*.txt to out.txt and print out
$ cat a* | tee out.txt | cat -n 1 a1 2 a2 $ cat out.txt a1 a2 -
default tee overwrite the file
# using `-a` to append $ cat a* | tee -a out.txt | cat -n -
use
stdinas a command argument using-$ echo who is this | tee -
-