Each process starts with three file descriptors ('fd's) set up: standard input, output and error streams (called 'stdin', 'stdout' and 'stderr' respectively) are always fd 0, fd 1 and fd 2 in that order, and for a simple shell command each of them is linked to the terminal.
By default, the shell applies '<' to fd 0 and '>' to fd 1, but you can override that by putting the numbers in. You can do funkier things like redirect one stream to another (eg find . 2>&1 | less lets you pipe the combined output and error streams into a pager).
Though the underlying file descriptors are supplied by the OS, these mechanisms for manipulating them are part of the shell - look at the 'bash' manpage for FMTYEWTK.
Hugo
|