tee
-
info
-
redirect
data to a file -
and provide a
copy
of redirect data asstdin
for next set of commands -
read from
stdin
only
-
-
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
stdin
as a command argument using-
$ echo who is this | tee -
-