next up previous contents
Next: 1.6 bash Environment Up: 1.5 Shortcuts Previous: 1.5.3 Redirection   Contents

1.5.4 1.5.4 Connecting with Pipes

It is possible to take the standard output of one command and direct it to the standard input of another command. This is known as piping. wc is a command the counts the number of words and characters. If we want to know how many words are in our manfiles.list, we can read the input of the wc command from the output of the cat command like this.

$ cat manfiles.list | wc

357 2111 14920
The symbol ``|'' is known as the ``pipe'' symbol. The standard output of the command on the left of the | becomes the input of the command to the right. We can string multiple commands together, to perform complex actions on data, using the pipe.