Study sets, textbooks, questions
Upgrade to remove ads
Practice quiz over pipes, redirection and filters
Terms in this set (12)
Show how cat can be used to create a file named test from keyboard input:
cat > test
this is my input
Show how to make one file called test out of three files called a b c:
cat a b c > test
What is a filter process?
A UNIX process that can easily be part of a pipeline, manipulating its input file and producing and output file from its input.
Examples are sort, cut, paste, wc, more, less, and cat.
What is a pipe?
A way to connect STDOUT of one command to STDIN of another, creating a pipeline or assembly line of processes by using the | character between the processes on the command line.
How does a pipe work?
The second process waits until the first process produces a character of input, then the first process waits until the second process reads the input from the pipe.
What is the default file for STDERR?
What is the default file for STDIN?
How do you redirect a process to use a file for STDIN instead of the keyboard?
Follow the command with < filename
What is the default file for STDOUT?
How do you redirect STDOUT to a different file when starting a process?
Follow the command with > filename
What three files are opened by default for a UNIX process?
Show how to use wc to count lines in a file called test:
cat test | wc
Recommended textbook explanations
Introduction to Algorithms
Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
John Buck, William Hayt
Computer Organization and Design MIPS Edition: The Hardware/Software Interface
David A. Patterson, John L. Hennessy
C++ Programming: Program Design Including Data Structures
D. S. Malik
Other sets by this creator
Practice quiz over git
Practice quiz over make and awk
Practice quiz over dd, tar, compression, etc