Computer Science - Linux - Discussion

Discussion Forum : 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?
tee
grep
cat
more
None of the above
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
2 comments Page 1 of 1.

Shahe Alam said:   9 years ago
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>

P. M. Aagjal said:   1 decade ago
What is the long form of tee?

Post your comments here:

Your comments will be displayed after verification.