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 command to print last 8 lines of any text file.
How do I use nslookup?
Write a command that will find all text files in a directory such that it does not contain the word "amazing" in any form (that is, it must include the words amazing, amazing, or amazing)?
How we will execute previous command in vi editor?
what is the difference between SED and GREP ? Which one is more better and why?
How to rename files and folders?
Where LOG fiels resides in AIX and pls tel me how to remove the log file
How do I run a whois command?
what is the meaning of this command rm -rf / what will it do ?
what are processor execution levels and priorities?
Name the general commands in using unix os for a beginner?
What are awk commands?