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 |
Can you enlist some commonly used network commands?
Is it inbetween or in between?
What is the comma to display different lines that are found when compare two files?
Through which command will redirect output to bOth screen and files at the same time?
what is the default signal kill in unix?
How can you change the owner or group of a file?
solaris Run level?
what is the command to find out the difference between files and folders?
what does a process mean?
How do I find previous commands in unix?
How to check whether some services are running in another server or not? Suppose i am currently in a server named A.I want to check whether some services are running in server B without logging into the server B.
3 Answers Amazon, MBA, Syntel, TCS, Unisys,
What is the difference between grep and grep?