Standard Streams and Redirection
Learn about stdin, stdout, stderr, and how to redirect them using `|`, `>`, `>>`, and `<`.
What are Standard Streams?
In the Linux terminal, commands communicate using 'standard streams'. Think of these as default channels for data to flow in and out of a program.
- Standard Input (stdin): Where a command gets its input from (usually keyboard).
- Standard Output (stdout): Where a command sends its normal results (usually screen).
- Standard Error (stderr): Where a command sends its error messages (usually screen).
These streams let you control how commands interact!
Standard Output (`stdout`)
When a command successfully runs and produces a result, that result is sent to standard output. By default, stdout is displayed directly on your terminal screen.
For example, when you use the echo command, its output goes to stdout.
All lessons in this course
- Standard Streams and Redirection
- Filtering Text with `grep`
- Text Manipulation with `sed` and `awk`
- Combining and Sorting Output with sort, uniq, and cut