Bash redirect stdout and stderr

From Hidden In Plain Sight
Jump to: navigation, search

Redirect stdout and stderr to a file (bash only)

command &>file.txt

Redirect stdout to a file (append mode) and set stderr to redirect to where stdout goes

command >>file.txt 2>&1