LPIC-1 Exam 101 (Linux Administrator) — Question 50
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"' outputs 'foo bar', which is then passed into 'tee bar', saving it to the file 'bar' and also passing it to 'cat'. Since 'cat' simply outputs what it receives, the final output is 'foo bar'. The other options do not represent the output generated by the command.