Redirection (computing)

The standard streams for input, output, and error

In computing, redirection is a form of interprocess communication, and is a function common to most command-line interpreters, including the various Unix shells that can redirect standard streams to user-specified locations. The concept of redirection is quite old, dating back to the earliest operating systems (OS).[citation needed] A discussion of the design goals for redirection can be found already in the 1971 description of the input-output subsystem of the Multics OS.[1] However, prior to the introduction of UNIX OS with its "pipes", redirection in operating systems was hard or even impossible to do.[2]

In Unix-like operating systems, programs do redirection with the dup2(2) system call, or its less-flexible but higher-level stdio analogues, freopen(3) and popen(3).[3]