Skip to main content
LESSON 1 of 5//Stream Processing

Standard input, output, and error

Every command in Unix has three default data streams: stdin (standard input, fd 0), stdout (standard output, fd 1), and stderr (standard error, fd 2). Understanding these streams is key to composing powerful command pipelines.

The three streamszsh // interactive
# stdout — normal output goes here
~echo 'This goes to stdout'
This goes to stdout
# stderr — error messages go here
~ls /nonexistent
ls: /nonexistent: No such file or directory
# stdin — input from keyboard or piped data
~cat # waits for stdin (type text, Ctrl+D to end)
PRACTICE//Try the commands from this lesson
INTERACTIVE_TERMINAL//sandbox
Practice terminal — try the commands from this lesson!
Type 'help' for available commands. Tab completion not available in simulator.
Try: