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 ...

Get A Practical Guide to Red Hat® Linux® 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.