O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

tee — stdin  stdout  - file  -- opt  --help  --version

Synopsis

tee [options] files

Like the cat command, the tee command copies standard input to standard output unaltered. Simultaneously, however, it also copies that same standard input to one or more files. tee is most often found in the middle of pipelines, writing some intermediate data to a file while also passing it to the next command in the pipeline:

$ who | tee original_who | sort

In this command line, tee writes the output of who to the file original_who, and then passes along that same output to the rest of the pipeline (sort), producing sorted output on screen.

Useful options

-a

Append instead of overwriting files.

-i

Ignore interrupt signals.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required