Capture both streams
Redirect stdout+stderr to file and screen simultaneously
command 2>&1 | tee /tmp/all.log
More linux commands
-
grep -rl 'old_string' /etc/ | xargs sed -i 's/old_string/new_string/g'Find files containing text, then replace in-place
-
awk '{print $1, $3}' /etc/passwdPrint 1st and 3rd fields of a space-delimited file
-
awk '{sum += $2} END {print sum}' file.txtSum values in column 2 of a text file
-
sed -i '/^#/d' config.confRemove all comment lines starting with #
-
sed -n '/START/,/END/p' file.txtPrint block of text between START and END markers