Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam LFCS topic 1 question 88 discussion

Actual exam question from Linux Foundation's LFCS
Question #: 88
Topic #: 1
[All LFCS Questions]

When given the following command line.
echo "foo bar" | tee bar | cat
Which of the following output is created?

  • A. cat
  • B. foo bar
  • C. tee bar
  • D. bar
  • E. foo
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
KMAV
12 months ago
Selected Answer: B
When the command line echo "foo bar" | tee bar | cat is executed, the following happens: echo "foo bar" prints "foo bar" to standard output (stdout). The | (pipe) symbol takes the output of the previous command and sends it as input to the next command. tee bar takes the input it receives from the pipe and writes it to standard output (stdout) as well as to a file named "bar". The second | (pipe) symbol takes the output of the previous command and sends it as input to the next command. cat takes the input it receives from the pipe and writes it to standard output (stdout). Therefore, the output that is created is: foo bar The output is printed to both the terminal (stdout) and the file "bar", but since the cat command only reads from standard input (stdin), it will only output "foo bar" to the terminal.
upvoted 1 times
...
rhylos
2 years, 8 months ago
tricky question. Output is "foo bar". file created is bar. Answer is correct
upvoted 2 times
...
rhylos
2 years, 8 months ago
Incorrect. Answer is D. output created bar. [student@centos ~]$ cat bar foo bar
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...