exam questions

Exam 101-500 All Questions

View all questions & answers for the 101-500 exam

Exam 101-500 topic 1 question 47 discussion

Actual exam question from LPI's 101-500
Question #: 47
Topic #: 1
[All 101-500 Questions]

Which of the following commands displays the output of the foo command on the screen and also writes it to a file called /tmp/foodata?

  • A. foo | less /tmp/foodata
  • B. foo | cp /tmp/foodata
  • C. foo > /tmp/foodata
  • D. foo | tee /tmp/foodata
  • E. foo > stdout >> /tmp/foodata
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
CuriousLinuxCat
Highly Voted 2 years, 11 months ago
D is correct. Keyword is 'tee'. Think of the letter 'T' where it sends information two-ways!
upvoted 13 times
rockk18
2 years ago
you saved me by your explanation in letter T, thank you.
upvoted 2 times
...
...
mentor84
Highly Voted 4 years, 2 months ago
cat foo | tee /tmp/foodata
upvoted 8 times
lanc
4 years, 1 month ago
foo is considered as a command. (as the question says the output of the command)
upvoted 13 times
...
...
Ninymo
Most Recent 3 months, 3 weeks ago
Answer: D
upvoted 1 times
...
M_ukesh8
11 months, 1 week ago
tee command generally gives std. output to screen and at the same time output can be append to file with -a flag. Condition: It needs a standard input via (|)
upvoted 2 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago