Linux Commands Reference - Complete Linux Command Guide

Comprehensive Linux command reference with 150+ commands. Search, filter by category, and view detailed usage examples.

Share
Back to commands

tee

Read stdin and write to stdout and files

Syntax

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

Common Options

-aAppend to file (no overwrite)
-iIgnore interrupt signals
-pDiagnose write errors

Common Examples

ls -la | tee output.txt

Output and save to file

ls -la | tee -a output.txt

Append to file

echo "test" | tee file1.txt file2.txt

Write to multiple files

make 2>&1 | tee build.log

Build output and save log

cat config.yml | tee /dev/tty | grep key

Display and filter simultaneously

df -h | tee >(grep "/$") > all_disks.txt

Split output stream

Related Commands

Related Tools

More Code & Dev Tools