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 |
How to find the files that are accessed before 10 minutes?
what is difference between unix and linux?
Enlist some filename manipulation commands in unix.
Why is it called grep?
What is the procedure of "at" and crontab" commands?
What does the command '$ls | wc –l > file1' do?
What command would users use to see what file one page at a time in UNIX?
Which unix command lists files/folders in alphabetical order?
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
In UNIX, what is the command to kill a process?
what is the use of ls -l command & what is the information it gives about user ?