The Linux pipe

Using the Linux pipe to pass information between commands.

What is the Linux pipe?

The Linux philosophy is that one tool should only perform only one task, in a way that complex workflows may be broken down into smaller tasks that can be resolved by combining multiple tools.

The Linux pipe is represented by the symbol | and provides a tool connecting the standard output of one command to the standard input of another command.

Using the Linux pipe

For instance, the standard output of a command command1 can be passed to the standard input of a command command2 using the sytax command1 | command2.

For instance:

cat file1.txt | head -n 5

Passing the standard output of a command to the standard input of another command using the Linux pipe.