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

What is the significance of the 'tee' command?

0 Answers  


what do you understand by 'unix is a portable os'?

3 Answers   Infosys,


Which mode is used for allowing file write,read and append mode?

9 Answers   BitWise, TM,


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?

4 Answers   HCL, Wipro,


A file has 1000 lines and i want to display only 1st line how to do it? pls ..tel me

7 Answers   CTS,






What are filter commands in unix?

0 Answers  


In UNIX, what is the command to kill a process?

10 Answers  


How do you find out all processes that are currently running in UNIX OS?

10 Answers  


How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?

0 Answers  


what does a process mean?

7 Answers   Infosys,


How do I search for a file in unix command?

0 Answers  


how to sort the content of the file based on numeric values

0 Answers   Epsilon,


Categories