Flowing data through multiple programs in a pipeline



Last revision August 3, 2004

Table of Contents:

  1. The Unix file system
  2. The directory tree
  3. File ownership and permissions
  4. Files as units
  5. Examining file contents
  6. Other commands
  7. Standard Files and Data Pipes

It is also possible to tie the standard output of one program to the standard input of another. This connection is called a pipe. It provides a convenient mechanism for data to flow from one program to another without having to save intermediate results on disk.

The pipe symbol is the vertical line: |

You create a pipe by typing a single command line that contains the names and arguments of the two programs to be connected, with the vertical line symbol between them. Multiple programs can be linked into a single pipeline in one command string.

Examples of pipelines:

Commands and programs that are designed to work in pipes are usually called filters and they read from standard input and write to standard output by default. To use these by themselves, not in a pipe, you must often redirect the input or output to point to a file.

<--Previous Overview Next-->