Stream Redirection
Core Idea
Commands have stdin, stdout, and stderr. Redirection sends those streams somewhere else.
Practice Alone
Save stdout to a file, save stderr to a different file, then combine them into one log.
Done When
You choose >, >>, 2>, 2>&1, and /dev/null deliberately.
Go Deeper
- I/O explains stdin, stdout, and stderr.
- File descriptors explains why stderr is descriptor
2. - Devices and
/dev/nullexplain discarded output. - One-liners explains grouped commands with one redirection.
- Shell explains how Bash sets up redirection before starting a command.

Linux Foundations