101-400 Exam QuestionsBrowse all questions from this exam

101-400 Exam - Question 44


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

Show Answer
Correct Answer: D

To send output from the program myapp to both standard output (stdout) and the file file1.log, you would use the command myapp | tee file1.log. The tee command takes the output from the preceding program (myapp), writes it to standard output (the screen), and also writes it to the specified file (file1.log), accomplishing both tasks simultaneously.

Discussion

3 comments
Sign in to comment
cast7omadrid1Option: D
Aug 5, 2019

I think option 'c' would also be valid. He tried it and does the same.

cast7omadrid1
May 16, 2020

I was wrong, it doesn't show on the screen, only D is valid

ciola89Option: D
Sep 11, 2023

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.

DuboisNicolasDuclairOption: D
Oct 21, 2023

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`.