what is the difference between pipe(|) and tee command..

Answers were Sorted based on User's Feedback



what is the difference between pipe(|) and tee command....

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

what is the difference between pipe(|) and tee command....

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 difference between pipe(|) and tee command....

Answer / guest

seperate arguments

Is This Answer Correct ?    2 Yes 3 No

Post New Answer

More Unix Commands Interview Questions

Can you enlist some commonly used network commands?

0 Answers  


Is it inbetween or in between?

0 Answers  


What is the comma to display different lines that are found when compare two files?

0 Answers  


Through which command will redirect output to bOth screen and files at the same time?

3 Answers  


what is the default signal kill in unix?

8 Answers   IBM,






How can you change the owner or group of a file?

1 Answers  


solaris Run level?

3 Answers   Wipro,


what is the command to find out the difference between files and folders?

6 Answers  


what does a process mean?

5 Answers   Infosys,


How do I find previous commands in unix?

0 Answers  


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?

0 Answers  


Categories