CompTIA Linux+ Powered by LPI (LX0-103) — Question 19
When given the following command line.
echo "foo bar" | tee bar | cat
Which of the following output is created?
Answer options
- A. cat
- B. foo bar
- C. tee bar
- D. bar
- E. foo
Correct answer: B
Explanation
The command 'echo "foo bar" | tee bar | cat' sends 'foo bar' to both 'tee' and 'cat'. The 'tee' command writes the output to the file 'bar' and also passes it along to 'cat', which then displays it. Therefore, the correct output is 'foo bar', while the other options do not represent the actual output generated by this command.