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

How to find the files that are accessed before 10 minutes?

5 Answers   Amazon,


what is difference between unix and linux?

6 Answers   IBM, Shell, Wipro,


Enlist some filename manipulation commands in unix.

0 Answers  


Why is it called grep?

0 Answers  


What is the procedure of "at" and crontab" commands?

4 Answers  






What does the command '$ls | wc –l > file1' do?

0 Answers  


What command would users use to see what file one page at a time in UNIX?

7 Answers   IBM,


Which unix command lists files/folders in alphabetical order?

0 Answers  


in unix echo is used for

10 Answers   BFL, BirlaSoft, Patni,


What Is the command to change a file's creation time. means one file is created at the time 15:19 then time should br changed to 14:14

8 Answers   3i Infotech, IBM,


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

10 Answers  


what is the use of ls -l command & what is the information it gives about user ?

5 Answers  


Categories