tee - Duplicate standard input

Synopsis

tee [-ai] [file ...]

Description

The tee utility copies standard input to standard output, making a copy in zero or more files. The output is unbuffered.

The tee utility takes the default action for all signals, except when the -i option is specified.

Options

-a
Append the output to the files rather than overwriting them.
-i
Ignore the SIGINT signal.

Environment Variables

tee is affected by the following environment variables:

QIBM_CCSID
The files created by tee are created with the CCSID specified by the value of the environment variable.

Exit Status

Related information

Examples
  1. Save the output of a command into three different files.
    grep 'off_set=' code/*.java | tee file1 file2 file3 > logfile
    
  2. Make a working and backup copy of the file, "back9".
    cat back9 | tee pro.tees pro.tees.bak