Read from standard input and write to both standard output and files.
tee splits output: it sends data to the screen and to one or more files at the same time.
ls | tee output.txt echo "hello" | tee file.txt
# Append instead of overwrite echo "log entry" | tee -a logfile.txt # Capture command output while viewing it make | tee build.log
-a to append instead of overwrite