Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
tee(1) OSS Shell and Utilities Reference Manual
NAME
tee - Displays program output and copies to a file
SYNOPSIS
tee [-ai][file ...]
The tee command reads standard input and writes both to standard output, and to each
specified file.
FLAGS
-a Adds the output to the end of file 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 file. The tee command can accept up to 20 file 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 file mylist.Ifmylist already exists, it is deleted and replaced.
2. To display the output of a command or program and append it to a file, 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 file listrecord does not exist, it is created.
RELATED INFORMATION
Commands: echo(1).
9−8 Hewlett-Packard Company 527188-003