3 examples for tee

{{ score }}
  # echo the text "hi" to STDOUT and to file.txt
echo "hi" | tee -a file.txt
        
{{ score }}
  # save your ruby irb session as you go
irb | tee -a save-todays-ruby-session.hist
        
{{ score }}
  # 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