Skip to content

Instantly share code, notes, and snippets.

@groman-me
Created September 21, 2012 04:58
Show Gist options
  • Save groman-me/3759800 to your computer and use it in GitHub Desktop.
Save groman-me/3759800 to your computer and use it in GitHub Desktop.
Bash redirects
To redirect stdout in bash, overwriting file
cmd > file.txt
To redirect stdout in bash, appending to file
cmd >> file.txt
To redirect both stdout and stderr, overwriting
cmd &> file.txt
To redirect both stdout and stderr appending to file
cmd >>file.txt 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment