06 Redirection Flashcards
What is the function of the “cat” command
Concatenate files
What is the function of the “sort” command
Sort lines of text
What is the function of the “uniq” command
Report (or omit) repeated lines
What is the function of the “grep” command
print lines of text matching a given pattern
What is the function of the “wc” command
Performs a word count; yields newlines, word count, and byte count of a file
What is the function of the “head” command
print ‘n’ lines from the beginning of a file
What is the function of the “tail” command
print the last ‘n’ lines from a file
What is the function of the ‘tee’ command
read from stdin, write to stdout AND to a file
Program output consists of what two types of data?
- Program execution results
2. Status/error messages
Programs send their output to a special file (typically the screen), known as … ?
Standard Output
What is the REDIRECTION operator?
>
What is the APPEND operator?
> >
If standard error has a file descriptor of ‘0’, where does the output go?
A file descriptor of ‘0’ sends error output to standard input
If standard error has a file descriptor of ‘1’, where does the output go?
A file descriptor of ‘0’ sends error output to standard output
If standard error has a file descriptor of ‘2’, where does the output go?
A file descriptor of ‘0’ sends error output to standard error