tee [ tiː ] is a standard Unix command . Its name derives from the tee (Engl. Tee connector ) from, install the plumbing a turn in a line.
The command reads data from
stdinand outputs them gradually
stdout and into a (new or existing) file. It is used to get intermediate results within a pipe . These can be used for error analysis or further processed in other pipes.
The existence and functionality as well as the behavior of this command are standardized by the Single UNIX Specification (SUS) as well as by the POSIX standard, in accordance with the IEEE standard 1003.1 from 1990.
According to the standard, tee understands two options: with appends
-a the specified file (instead of opening a new empty file) and with ignores
The command is also included in the GNU Core Utilities .
This example filters the files and directories in the root directory for all that
bcontain a. At the same time a file is
out.filecreated with all files and directories in the root directory.
ls -l / | tee out.file | grep b
tee: duplicate standard input - Open Group Base Specification
tee(1): pipe fitting - OpenBSD General Commands Manual
tee(1): Read from standard input and write to standard output and files - Debian GNU / Linux Executables or Shell Commands man page