What is the difference between pipe (|) and tee command in unix

Answer Posted / worsame abid

A Pipe is two or more commands seperated by pipe chat "|".
That tells the shell to arrange for the output of the
proceeding command to be passed as input to the following
example.

$ls |wc -l

this will mean that output of ls command will serve as
input for wc command as result we will get total number of
files in current directory.



Tee is normally used to split the output of a program so
that it can be seen on the display and also be saved in a
file ,The tee command reads standard input, then writes its
content to standard output and simultaneously copies it
into the specified file(s) or variables.

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the first character of the output in ls l command?

625


Are you in or at the office?

606


What is grep r?

580


What does the command ' $who | sort –logfile > newfile' do?

757


Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?

628






Why is awk called awk?

573


How does pipe () work?

585


What is the use of find command in unix?

572


Which command is used to kill the last background job?

767


Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?

786


What is unix command?

575


Why is grep called grep?

771


Which command will print your home directory on screen?

536


Why is shebang used?

588


What is time_t?

578