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