Skip to main content
Linux AdministrationMediumSingle Choice

Linux Administration Question

Statement

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

#tee#stdout#redirection#pipe#myapp
A

cat < myapp | cat > file1.log

B

myapp 0>&1 | cat > file1.log

C

myapp | cat > file1.log

D

myapp | tee file1.log

Correct
E

tee myapp file1.log

Resolution & Explanations

The tee command reads from standard input and writes to both standard output and one or more files simultaneously.