Linux_FoundationLinux_Foundation
LFCS · Question #863
LFCS Question #863: Real Exam Question with Answer & Explanation
The correct answer is B: foo bar. The echo command outputs "foo bar", which tee writes to a file named bar and also passes to cat, resulting in "foo bar" being printed to standard output.
Submitted by suresh_in· Apr 18, 2026Essential Commands
Question
When given the following command line. echo "foo bar" | tee bar | cat Which of the following output is created?
Options
- Acat
- Bfoo bar
- Ctee bar
- Dbar
- Efoo
Explanation
The echo command outputs "foo bar", which tee writes to a file named bar and also passes to cat, resulting in "foo bar" being printed to standard output.
Common mistakes.
- A.
catis the command itself, and it will output its input, not its own name. - C.
tee baris a command and arguments; the output of the pipeline is the data processed by the commands, not the command names. - D.
baris the name of the file created bytee, not the data being passed through the pipeline to standard output. - E.
foois only part of the string; the entire string "foo bar" is processed and output.
Concept tested. Command piping and tee utility
Reference. https://www.gnu.org/software/coreutils/manual/html_node/tee-invocation.html
Topics
#Pipes#Standard I/O#tee command#Shell commands
Community Discussion
No community discussion yet for this question.