Computer Science - Linux - Discussion

Discussion :: Linux - Section 2 (Q.No.1)

1. 

What command is used to save the standard output in a file, as well as display it on the terminal?

[A]. tee
[B]. grep
[C]. cat
[D]. more
[E]. None of the above

Answer: Option A

Explanation:

No answer description available for this question.

P. M. Aagjal said: (Jan 16, 2015)  
What is the long form of tee?

Shahe Alam said: (Dec 12, 2015)  
Tee command is used to store and view (both at the same time) the output of any other command.

Tee command writes to the STDOUT, and to a file at a time as shown in the examples below.

1. The following command (with the help of tee command) writes the output both to the screen (stdout) and to the file.

$ ls | tee <file>

By default tee command overwrites the file. You can instruct tee command to append to the file using the option A as shown below:

$ ls | tee "a <file>

You can also write the output to multiple files as shown below:

$ ls | tee <file1 file2 file3>

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.