101-400 Exam QuestionsBrowse all questions from this exam

101-400 Exam - Question 80


When given the following command line.

echo "foo bar" | tee bar | cat

Which of the following output is created?

Show Answer
Correct Answer: B

The command 'echo "foo bar" | tee bar | cat' performs the following steps: 1. 'echo "foo bar"' outputs the string 'foo bar'. 2. 'tee bar' receives this output, writes 'foo bar' to a file named 'bar', and also passes it to the next command in the pipeline. 3. 'cat' then receives 'foo bar' from 'tee' and outputs it to the terminal. Therefore, the final output displayed on the terminal is 'foo bar'.

Discussion

1 comment
Sign in to comment
DuboisNicolasDuclairOption: B
Oct 21, 2023

The output created by the command `echo "foo bar" | tee bar | cat` is: E. `foo` Here's how the command works: 1. `echo "foo bar"` prints "foo bar" to the standard output. 2. `tee bar` copies the input it receives to both the standard output (which is piped to the next command) and to a file named "bar." 3. `cat` reads from the standard input and prints what it receives. So, "foo bar" is the content that is printed to the standard output and displayed in your terminal.