what is the difference between pipe(|) and tee command..
Answers were Sorted based on User's Feedback
Answer / manoj gadtia
pipe direct output of one command to the input of another
command
ls -l | wc
tee command reads standard input, then writes the output
to standard output and simultaneously copies it into the
specified file or files
ls -l | wc -l | tee out.txt
It shows the output and also write the result into out.txt
file
| Is This Answer Correct ? | 9 Yes | 1 No |
Answer / mohit chandila
A Pipe would allow you to direct output of one command to
the input of another command ie. directs a stream from one
file to another.
A Tee command does the same job of directing streams
however it directs the stream to two destinations direction
one is the direction where the stream would otherwise end
up if there was no Tee command And the other direction is
the file that is argument to Tee command.
So, A Tee is used in Pipes to direct streams to an outside
file without interrupting the regular propagation of stream
in the pipe.
eg.
Pipe
----------------------------------------
Output of A Input of B
----------------------------------------
Pipe
----------------------------------------
Output of A ======== Input of B
----------------||----------------------
||
||
Input of C
| Is This Answer Correct ? | 9 Yes | 3 No |
Which unix command lists files/folders in alphabetical order?
what do you understand by 'building block primitive'?
Where LOG fiels resides in AIX and pls tel me how to remove the log file
How can we "forked" process in UNIX? How then recognize in any of the branches we?
What are reported commands?
hw will u use awk in replacing cahrs and files
what is the difference between KILL and KILL -9?
5 Answers Informatica, Nutanix,
What do chmod, chown, chgrp commands do?
Using unix command how to display no of records in oracle?
how to unzip the contents of the gzip file
How to replace the exact word in vi editor?? suppose a file contains words like amaze,amazed,amazement in some of the line.But i want to replace only 'amaze' with delight but don't wanna replace amazed or amazement. thanks
6 Answers Polaris, Tech Mahindra,
How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?