103.4 Use streams, pipes and redirects Flashcards
What does the command xargs do?
It will take the stdout of one command and use it as stdin in another command as options, just like -exec but it is more efficient.
What does the command xargs do?
It will take the stdout of one command and use it as stdin in another command as options, just like -exec but it is more efficient.
What does the tee command do?
It redirects stdout from one command to a file while at the same time printing the stdout to the screen to be seen.
What does this command do? #ls -d /usr/share/doc/lib[Xx]* | tee lib.docs.txt
- It lists only directories within /usr/share/doc/lib
- The directories to be listed start with a capital or lowercase X
- The stdout gets written to the file lib.docs.txt while being printed on the screen.
What symbol do you use to redirect stdout as stdin to a command?
pipe |
How do you redirect stdin towards a command?
What symbols do you use to append stdout to a file?
> >
What does the tee command do?
It redirects stdout from one command to a file while at the same time printing the stdout to the screen to be seen.
What does this command do? #ls -d /usr/share/doc/lib[Xx]* | tee lib.docs.txt
- It lists only directories within /usr/share/doc/lib
- The directories to be listed start with a capital or lowercase X
- The stdout gets written to the file lib.docs.txt while being printed on the screen.
What symbol do you use to redirect stdout as stdin to a command?
pipe |
Give an example of standard output and standard input.
#wc test.sh # wc < test.sh cat /etc/passwd | less
What symbols do you use to append stdout to a file?
> >
How do you redirect stdout and stdin of a script to the less command?
test.script 2>&1 | less
Which are the file handles for stdout, stdin and stderr?
stdin < 0
stdout > 1
stderr : 2
Where is stderr printed?
It is printed to the screen just like stdout
How is standard error abbreviated?
Stderr
Give an example of standard output and standard input.
#wc test.sh # wc < test.sh
How is standard input abbreviated as?
stdin
What are the symbols used for stdin?
< and pipe ( | )
Where does standard input come from?
It comes from the user’s input on the keyboard.
Also sodut of a command can be the stdin or another.
What are the symbols used to redirect stdout?
> and»_space;
What is stdout?
It is whatever you see printed on the screen when you run a command.
How is standard output abbreviated?
stdout
How can you retrieve the process IDs that are related to a particular user?
psgrep -u