tee
Copies standard input to standard output and one or more files
tee [options] file-list
The tee utility copies standard input to standard output and to one or more files you specify on the command line.
Arguments
The file-list contains the pathnames of files that receive output from tee.
Options
Without any options, tee overwrites the output files if they exist and responds to interrupts. If a file in file-list does not exist, tee creates it.
--append
-a Appends output to existing files rather than overwrites them.
--ignore-interrupts
-i Causes tee not to respond to interrupts.
Example
In the following example, a pipe sends the output from make to tee, which copies it to standard output and the file accounts.out. The copy that goes to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access