Coreutils tee

From wikinotes
Revision as of 23:02, 29 December 2023 by Will (talk | contribs) (Created page with "Tee reads from standard input,<br> and writes to a file(s)<br> in addition to the standard output. = Usage = <blockquote> <syntaxhighlight lang="bash"> # write input to multiple files echo foo | tee /out/file1 /out/file2 # pipe input to multiple commands echo foo | tee >(cat /dev/stdin) >(cat /dev/stdin) </syntaxhighlight> </blockquote><!-- Usage -->")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Tee reads from standard input,
and writes to a file(s)
in addition to the standard output.

Usage

# write input to multiple files
echo foo | tee /out/file1 /out/file2

# pipe input to multiple commands
echo foo | tee >(cat /dev/stdin) >(cat /dev/stdin)