Most UNIX commands expect input to come from a file(s), and produce output to another file(s). ``One of these files is the Standard Input, and is the place from which a program expects to read its input. Another is called the Standard Output, and it is the file to which the program writes its results. The third file is the Diagnostic Output (also called Standard Error), and it is a file to which the program writes any error responses" [p. 85]HM:UNIX.
Table shows a summary on how input/output redirection may be used.
Generally, the standard input is taken to be the keyboard (input is typed by the user), the standard output is the terminal screen, as is the standard error. They are known as file descriptor 0, 1 and 2 respectively.