All tags
redirection
- Tip
cmd > file 2>&1In bash, 2>&1 only follows where stdout points at that momentExplains why `cmd > file 2>&1` and `cmd 2>&1 > file` send errors to different places.3 Dec 2026 - Tip
exec > >(tee -a /var/log/nightly.log) 2>&1exec with tee logs everything a shell script printsSend all output of a script to a log file while you still see it on screen.30 Nov 2026 - Tip
exec 3>>report.logexec 3> keeps a file open for the rest of a shell scriptOpen a log file once and write to it many times through a number.30 Nov 2026 - Tip
set -o noclobberset -o noclobber stops > from overwriting existing filesBlocks the > operator from overwriting existing files unless you use >|.28 Nov 2026 - Tip
make 2>&1 | lessUse |& to pipe stderr along with stdout in BashSends both normal output and error messages through the pipe, shorter than 2>&1.24 Oct 2026
Nothing matches.