whatis standard-streams
stdin, stdout, stderr
Also known as: standard streams, standard input, standard output, standard error, file descriptors 0 1 2
The three streams every process starts with: standard input (fd 0), standard output (fd 1), and standard error (fd 2).
What Are stdin, stdout, and stderr in Linux?
By default all three are connected to your terminal. Programs read input from stdin, write normal results to stdout, and write errors and diagnostics to stderr. Keeping errors on a separate stream means you can pipe clean output to another tool while still seeing problems.
The numbers 0, 1, and 2 are file descriptors, and they are what redirection syntax refers to. Each process can see its own under /proc/self/fd/.
Example
find / -name "*.conf" 2>/dev/null Learn more about stdin, stdout, stderr
- I/O Redirection and Pipes Explained Every Linux command reads from standard input and writes to standard output and standard error. This guide explains those three streams and how to redirect and chain them with >, >>, <, 2>&1, pipes, and xargs.