Bash - Redirecting stdout and stderr
14 Mar 2016Redirect stdout
/stderr
to a truncated file:
Redirect stdout
/stderr
to a file (appending):
Redirect both stdout
and stderr
in same command to different files (truncating):
Redirect both stdout
and stderr
to same output (truncating):
“Redirection statements are evaluated, as always, from left to right. >> file
- STDOUT
to file (append mode) (short for 1>> file
) 2>&1
- STDERR
to ‘where stdout goes’ Note that the interpretation ‘redirect STDERR
to STDOUT
’ is wrong”