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 protocol for PING command?
Where can I get the free download of Unix by Yeswant Kanetkar?
How to know a process is a zombie or orphan process?
what is the default permission for /etc/shadow file in UNIX
what does the 'tee' command do?
what these two commands prints "echo test","cat test"?
How to rename files and folders?
What is the difference between cat command and more command?
How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?
how unix kernel distinguishes between a normal file and device file ?
7 Answers Google, IBM, McAfee, Vodafone,
How do you find which version and name of unix you are using at the command prompt?
What do chgrp command do?