Ch.6 Redirection Flashcards
What does I/O stand for
Input/output
What does I/P redirection allow us to do?
Redirect the input and output of commands to and from files, as well as connect multiple commands together
What does cat do
Concatenate files
what does sort do?
Sort lines of text
what does uniq do?
Report or omit repeated lines
What does grep do
Print lines matching a pattern
what does wc do?
Print newline, word, and byte counts for each file
what does head do?
Output the first part of a file
what does tail do
Output the last part of a file
What does tee do?
Read from standard input and write to standard output and files
What are the two types of output?
- The program’s results (the data the program is designed to produce) 2. Status and error messages that tell us how the program is getting along.
What is expressed as stdout?
standard output
What is expressed as stderr?
standard error
What are linked by default to the screen and not saved into a disk file?
Standard Error and Standard Output
What is expressed as stdin?
standard input
What is by default attached to the keyboard?
standard input
What key is the redirection operator
>
What will truncate an existing file or create a new, empty file?
Simply using the redirection operator with no command preceding it. i.e. > ls-output.txt
What does the shell reference internally as file descriptors 0,1,2?
Standard input, output, and error, respectively
What redirection must refer to its file descriptor?
Standard Error
How do you dispose of unwanted output?
/dev/null
What does conatenating files do?
the command reads one or more files and copies them to standard output.
What happens if cat is not given any arguments?
It reads from standard output. (It’s waiting for you to type something)
How do you tell cat it has reached EOF?
Ctrl-D