Table of Contents

IO - Standard streams (stdin, stdout, stderr)

About

Standard Streams are the mechanism by which a process:

At the command line (Repl, Shell)

In a shell, by default, they will:

They are the building block of interaction with the user in a command line environment. The application catch them and manipulate them to interact with the user or other programs.

List

The three I/O connections are called:

Implementation

They are open files that point to the standard input, standard output, and standard error file descriptors.

They are properties of every process

Language

Language stdin stdout stderr
Java System.in System.out System.err
C Unix file descriptors 0 Unix file descriptors 1 Unix file descriptors 2
Bash (Shell) stdin /dev/stdout stderr

Method

Redirection

Standard streams also support I/O on files and between programs, but that feature is controlled by the command line interpreter, not the program.

See What are Shell Redirections? of Standard Streams