If you want to log to the same file:
command1 >> log_file 2>&1
If you want different files:
command1 >> log_file 2>> err_file
More Related Contents:
- How to redirect and append both standard output and standard error to a file with Bash
- Redirect stderr and stdout in Bash [duplicate]
- Shell redirection i/o order
- How can I pipe stderr, and not stdout?
- Bash script – store stderr in a variable [duplicate]
- Piping both stdout and stderr in bash?
- Capture both stdout and stderr in Bash [duplicate]
- How to store standard error in a variable
- Bash how do you capture stderr to a variable? [duplicate]
- Capture stdout and stderr into different variables
- Send string to stdin
- What is the name for `
- How to store the output of a command in a variable at the same time as printing the output?
- How to pipe stdout while keeping it on screen ? (and not to a output file)
- How do file descriptors work?
- pipe stdout and stderr to two different processes in shell script?
- How to redirect a program that writes to tty?
- How to pass a variable containing slashes to sed
- While-loop subshell dilemma in Bash
- Variables in bash seq replacement ({1..10}) [duplicate]
- Intersection of two lists in Bash
- Compound ‘if’ statements with multiple expressions in Bash
- Remove first N lines of a file in place in unix command line
- How to address error “bash: !d’: event not found” in Bash command substitution [duplicate]
- How to write a bash script that takes optional input arguments?
- Checking Bash exit status of several commands efficiently
- How to remove filename prefix with a Posix shell
- Root user/sudo equivalent in Cygwin?
- How to tell if a string is not defined in a Bash shell script
- How to grep for case insensitive string in a file?