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 protocol for PING command?

1 Answers   IBM,


Where can I get the free download of Unix by Yeswant Kanetkar?

5 Answers  


How to know a process is a zombie or orphan process?

3 Answers   Perot Systems,


what is the default permission for /etc/shadow file in UNIX

2 Answers   Wipro,


what does the 'tee' command do?

4 Answers  






what these two commands prints "echo test","cat test"?

6 Answers   TCS, Wipro,


How to rename files and folders?

7 Answers   IBM, Oracle,


What is the difference between cat command and more command?

0 Answers  


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

0 Answers  


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?

7 Answers  


What do chgrp command do?

0 Answers  


Categories