Stdout

Updated: 11/10/2017 by Computer Hope

Standard output (illustration)Stdout, also known as standard output, is the default file descriptor where a process can write output.

In Unix-like operating systems, such as Linux, macOS X, and BSD, stdout is defined by the POSIX standard. Its default file descriptor number is 1.

In the terminal, standard output defaults to the user's screen.

Stdout in the command pipeline

In bash, sequential commands can be connected by pipes, represented on the command line by a vertical bar ("|"). The commands in the pipeline are processed left-to-right, with the standard output (stdout) of each command connecting to the standard input (stdin) of the next.

For instance, in this pipeline of two commands:

fortune | cowsay

The program fortune, which normally prints a random quotation to the user's screen, instead connects its output (stdout) to the input (stdin) of the command on the right:

Standard output of fortune piped to cowsay

For more information about standard output, see redirection in bash.

Operating System terms, Bash, Linux