What are standard input, standard output, and standard error?
Quick answer
In the conventional Bash model, standard input (stdin, file descriptor 0) is the channel a command can read from; standard output (stdout, descriptor 1) carries ordinary output; and standard error (stderr, descriptor 2) carries diagnostic output. Bash can redirect these channels, so their destinations can change. [S1]
The question, the details, the next step.
A practical checklist
Check whether an example is describing Bash before applying the descriptor numbers.
Identify the command’s input channel: stdin (0).
Distinguish ordinary output, stdout (1), from diagnostic output, stderr (2).
Remember that Bash redirections can change where channels lead.
Treat PowerShell’s documented streams as distinct from the conventional Bash model.
A few more useful answers
Does stderr mean that a command definitely failed?
The channel is used for diagnostic output in the conventional Bash model; the channel name alone does not establish whether a command succeeded or failed. [S1]
What do the numbers 0, 1, and 2 refer to?
They are the conventional Bash file descriptor numbers for standard input, standard output, and standard error, respectively. [S1]
Is a PowerShell pipeline standard input?
No. PowerShell’s ordinary pipeline should not be described as standard input in the conventional Bash model. [S2]
Sources
References used for this guide.
- [S1] GNU Bash Reference Manual: Redirections and file descriptors gnu.org · Checked
- [S2] PowerShell 7.2: about_Output_Streams learn.microsoft.com · Checked
