tee (Unix)
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 stdin
and 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 -i
the signal SIGINT
.
The command is also included in the GNU Core Utilities .
example
This example filters the files and directories in the root directory for all that b
contain a. At the same time a file is out.file
created with all files and directories in the root directory.
ls -l / | tee out.file | grep b
Web links
-
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