Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ssendeavour/04a2e611f02950f882cf to your computer and use it in GitHub Desktop.
Save ssendeavour/04a2e611f02950f882cf to your computer and use it in GitHub Desktop.
How do I write stderr to a file while using “tee” with a pipe?
# stackoverflow.com/questions/692000/how-do-i-write-stderr-to-a-file-while-using-tee-with-a-pipe
command_to_execute 2>&1 | tee -a log
# in bash 4
command_to_execute |& tee -a log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment