Created
September 21, 2012 04:58
-
-
Save groman-me/3759800 to your computer and use it in GitHub Desktop.
Bash redirects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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