tee(1)

tee1

Duplicate standard input

Usage

tee [-ai] [file ...]

Overview

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

The following options are available:

-a

Append the output to the files rather than overwriting them.

-i

Ignore the SIGINT signal.

The following operands are available:

file

A pathname of an output file.

The tee utility takes the default action for all signals, except in the event of the -i option.

Exit status

The tee utility exits 0 on success, and >0 if an error occurs.

Examples

Send the echoed message both to stdout and to the greetings.txt file:

$ echo "Hello" | tee greetings.txt
Hello

Releases

163 releases since Mac OS X 10.0; the text changed 1 time.

  1. 10.0–11.5
  2. 12.0.1–26.5

Standards

The tee utility is expected to be IEEE Std 1003.2 (“POSIX.2”) compatible.

From shell_cmds 329 in macOS 26.5. Parsed by carta from the page's mdoc source.