Redirect both stdout and stderr to file.
command > output.log 2>&1
Redirect stdout and stderr to different file
command > output.log 2>error.log
Use >>
for append instead of overwrite.
command >> output.log 2>&1
Without 2>&1
it will capture stdout
only.
command > output.log
The folowing command also redirect both stdout and stderr to file, but it might not be well supported on all version and platform.
command &> output.log