tee (Unix)

from Wikipedia, the free encyclopedia
The operation of tea : the issues of the commands ls -lare tea firstly to the pager lessrouted to another in the file file.txt . The stream history diagram looks like a tee , hence the name.

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

Web links

Individual evidence

  1. tea. Single Unix® Specification, Version 2. Open Group, 1997, accessed on May 6, 2013 .