Display & log command output simultaneously

November 6th, 2006 toydi Posted in Common, tee | Hits: 70195 | No Comments »

To display and log the output from a command at the same time:

ls -l | tee -a file.log 

In this example, it will display the directory listing output and as well, save the output into file.log. The option -a signals the command to append rather than overwrite the file.

Leave a Reply