exam questions

Exam 101-400 All Questions

View all questions & answers for the 101-400 exam

Exam 101-400 topic 3 question 12 discussion

Actual exam question from LPI's 101-400
Question #: 12
Topic #: 3
[All 101-400 Questions]

Which of the following commands will send output from the program myapp to both standard output (stdout) and the file file1.log?

  • A. cat < myapp | cat > file1.log
  • B. myapp 0>&1 | cat > file1.log
  • C. myapp | cat > file1.log
  • D. myapp | tee file1.log
  • E. tee myapp file1.log
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
DuboisNicolasDuclair
1 year, 4 months ago
Selected Answer: D
The command that will send output from the program `myapp` to both standard output (stdout) and the file `file1.log` is: D. `myapp | tee file1.log` The `tee` command is used to read from standard input and write to standard output and files. In this case, it takes the output of `myapp` and both displays it on the terminal and writes it to the file `file1.log`.
upvoted 1 times
...
ciola89
1 year, 6 months ago
Selected Answer: D
The tee command, used with a pipe, reads standard input, then writes the output of a program to standard output and simultaneously copies it into the specified file or files. Use the tee command to view your output immediately and at the same time, store it for future use.
upvoted 1 times
...
cast7omadrid1
5 years, 7 months ago
I think option 'c' would also be valid. He tried it and does the same.
upvoted 1 times
cast7omadrid1
4 years, 10 months ago
I was wrong, it doesn't show on the screen, only D is valid
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago