Skip to main content

tee is a command line utility that reads the standard input and writes to the standard output as well as a file specified as an argument. Use this tag for questions about the tee command.

tee is a standard utility that reads from standard input and writes the same output to standard output and files given on the command line.

Example

Taking simple file as this:

$ cat file
AAA
AAAA
AAAAA

These commands will count the rows in the file and write it in file_tee. If file_tee is not empty the contents would be truncated.

$ wc -l file | tee file_tee
3 file

Further reading