terminal.cab

All commands

tee

Topic: Text

Program: tee

Writes its input to the screen and into files.

Package: tee

Usage

tee [OPTION]... [FILE]...

Description

Copy what comes from the keyboard or pipe to standard output and into every FILE.

Options in the simulator

4 more options of the real program, not in the simulator yet
  • -i, --ignore-interrupts not in the simulator yet

    On a real system tee then keeps running when you press Ctrl+C.

  • -p not in the simulator yet

    On a real system it decides what tee does when writing fails, for example into a closed pipe.

  • --output-error value optional not in the simulator yet

    On a real system it decides what tee does when writing fails, for example into a closed pipe.

  • --version not in the simulator yet

    On a real system it prints the version of the program.

Examples

From the lesson Branching off and passing on
ls cache | tee inventory.txt
a.tmp
b.tmp
keep.log
old report.tmp
echo "checked 09:45" | tee -a inventory.txt
checked 09:45
cat inventory.txt
a.tmp
b.tmp
keep.log
old report.tmp
checked 09:45

Try it in the terminal

Where you learn it

Lessons

All commands