Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

tee(1) OSS Shell and Utilities Reference Manual
NAME
tee - Displays program output and copies to a le
SYNOPSIS
tee [-ai][le ...]
The tee command reads standard input and writes both to standard output, and to each
specied le.
FLAGS
-a Adds the output to the end of le instead of writing over it.
-i Ignores the SIGINT signal.
DESCRIPTION
The tee command is useful when you wish to view program output as it is displayed, and also
want to save it in a le. The tee command can accept up to 20 le arguments.
The tee command does not buffer output.
EXAMPLES
1. To view and save the output from a command at the same time, enter:
ls | tee mylist
This displays the standard output of the command ls at the terminal, and at the same time
saves a copy of it in the le mylist.Ifmylist already exists, it is deleted and replaced.
2. To display the output of a command or program and append it to a le, enter:
ls | tee -a listrecord
This displays the standard output of ls at the terminal and at the same time appends a
copy of it to the end of listrecord. If the le listrecord does not exist, it is created.
RELATED INFORMATION
Commands: echo(1).
98 Hewlett-Packard Company 527188-004