Linux Foundation Certified System Administrator (LFCS) — Question 78

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

Answer options

Correct answer: D

Explanation

The correct answer is D, as the 'tee' command allows output to be split, sending it simultaneously to the specified file and standard output. Options A, B, and C do not achieve this functionality since they either redirect output to a single channel or do not utilize the 'tee' command. Option E incorrectly attempts to use 'tee' with the program name instead of directing the program's output.