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 |
What is the significance of the 'tee' command?
what do you understand by 'unix is a portable os'?
Which mode is used for allowing file write,read and append mode?
How to set sticky bit, or it have any seperate directory to create sticky bit in sunfir servers. Please help me , i don't no the exact answer?
A file has 1000 lines and i want to display only 1st line how to do it? pls ..tel me
What are filter commands in unix?
In UNIX, what is the command to kill a process?
How do you find out all processes that are currently running in UNIX OS?
How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?
what does a process mean?
How do I search for a file in unix command?
how to sort the content of the file based on numeric values