Redirect both stdout and stderr to file.
command > output.log 2>&1Redirect stdout and stderr to different file
command > output.log 2>error.logUse >> for append instead of overwrite.
command >> output.log 2>&1Without 2>&1 it will capture stdout only.
command > output.logThe 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