Command pipeline
- The output of 1 command is directed to the input of the another to form a pipeline.
A pipe is used by the shell to connect the stdout of one command directly to the stdin of another command.
Example
- STDERR is not passed down the pipe (BY Default)
- The symbol for a pipe is the vertical bar ( | ). The command syntax is:
command1 [arguments] | command2 [arguments]
Operation 1 who > temp sort temp Operation 2 who | sort
ls -al | more who | more ps ug | grep myuserid who | grep kelly
tee enables the stream to be diverted.
Example:
ls | tee somefile | sort | more
Building commands
- Shells provide glue to build complex commands
References
0 comments:
Post a Comment