December 1999
Beginner
528 pages
11h 10m
English
When issuing commands, you can specify where you want the standard input, output and errors to go, and to be able to do this you need to do a bit of redirection. A combination of the most useful redirections with corresponding file descriptors is shown in Table 5.1.
When using standard error in redirection, you must use a file descriptor, but for standard input and output this is optional. Table 5.1 shows both methods for completeness.
| Command > filename | Send standard output to a new filename |
| Command >> filename | Send standard output to filename (appended) |
| Command 1 > filename | Send standard output to filename |
| Command > filename 2>&1 | Send all output (including errors) to filename ... |
Read now
Unlock full access