3 examples for tee
# Directs the output of a command simultaneously to both stdout and a log # file, eg. list all files/directories in $HOME and also save that list to (i.e. overwrite) logfile.txt: ls ~ | tee ~/logfile.txt # Alternatively, append to logfile.txt instead of overwriting: ls ~ | tee -a ~/logfile.txt