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
redirect both stdout and stderr appending to file
cmd >>file.txt 2>&1
No comments:
Post a Comment