February 2001
Beginner to intermediate
448 pages
9h 2m
English
As discussed in the previous chapter, a file descriptor is a small integer value representing an open file. You might recall the three famous (infamous) file descriptors: stdin, stdout, and stderr. These mnemonics represent file descriptors 0, 1, and 2, respectively. They are usually open and typically represent your terminal display device. When you use the redirection symbols on the command line, you are altering file descriptor 0, or 1, or 2 (stdin, stdout, or stderr).
The following example uses the > and >> symbols to redirect output to a file (>), and also to redirect output and append it to an existing file (>>):
$ date > stats # Put output of date command into stats file $ vmstat >> stats # Append vmstat output into stats ...
Read now
Unlock full access