Skip to content

Instantly share code, notes, and snippets.

@pokka
Last active August 29, 2015 14:15
Show Gist options
  • Save pokka/03249f851f9f60448af9 to your computer and use it in GitHub Desktop.
Save pokka/03249f851f9f60448af9 to your computer and use it in GitHub Desktop.
Run linux cmd with a target output and run in background
cmd > log 2>&1 &
#Redirects STDOUT to log and than replaces STDERR with the redirected STDOUT.
cmd 2>&1 > log &
#Replaces STDERR with STDOUT and then redirects the original STDOUT to log.
cmd 2>&1 > /dev/null &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment