Redirection

UNIX allows you to re-direct the output of a process from the normal standard output device to another destination such as a printer or a file:

You can also redirect a process's input source. Instead of letting it assume that it should get its input from the normal console keyboard, you can tell it to get its input from another terminal, a file or an input port:

You can also pipe the output of a process directly to another without storing the data in an intermediate file. The most common uses of the pipe are as follows:

Unix Command Meaning
ls | more feed directory listing one screen-full at a time
ls | lp send directory listing to printer instead of screen

You can also pipe the output of an initial process through more than one intermediate process before outputting the result. Intermediate processes are referred to as filters. An example of a filter is the sort process:


This page's parent within this Web Site. About this Web Site. Its home page. Email its Author.