NAME

tee - Copy standard input to each FILE, and also to standard output.

SYNOPSIS

tee [-h|--help] [-a|--append] [-i|--ignore-interrupts] [-p ] [--output-error] [-V|--version] [file]

DESCRIPTION

Copy standard input to each FILE, and also to standard output.

OPTIONS

-h, --help

Print help

-a, --append

append to the given FILEs, do not overwrite

-i, --ignore-interrupts

ignore interrupt signals (ignored on non-Unix platforms)

-p

set write error behavior (ignored on non-Unix platforms)

--output-error

set write error behavior

Possible values:

  • warn: produce warnings for errors writing to any output

  • warn-nopipe: produce warnings for errors that are not pipe errors (ignored on non-unix platforms)

  • exit: exit on write errors to any output

  • exit-nopipe: exit on write errors to any output that are not pipe errors (equivalent to exit on non-unix platforms)

-V, --version

Print version

[file]

EXTRA

If a FILE is -, it refers to a file named - .

VERSION

v(uutils coreutils) 0.10.0

EXAMPLES

Copy `stdin` to each file, and also to `stdout`:

echo "example" | tee path/to/file

Append to the given files, do not overwrite:

echo "example" | tee [-a|--append] path/to/file

Print `stdin` to the terminal, and also pipe it into another program for further processing:

echo "example" | tee /dev/tty | xargs printf "[%s]"

Create a directory called "example", count the number of characters in "example", and write "example" to the terminal:

echo "example" | tee >(xargs mkdir) >(wc [-c|--bytes])

The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail.