Piping
Description
Piping is the connection of the standard output of one command to the standard input of another command.
Piping uses the pipe character.
Redirection breaks pipelines
Standard
commandOne -options arguments | commandTwo -options arguments |
|
Taking snapshots of pipeline with 'tee' command
commandOne -options arguments | tee snapshot.txt | commandTwo -options arguments |
Data coming out of commandOne is saved in snapshot.txt, but the data is also successfully piped through to commandTwo |
Piping to commands that only accept command line arguments
commandName -options arguments | xargs echo |
The long form, using the stream number |
commandName -options arguments < input_source |
The short form with no stream number |
Examples