The ability of commands to read data from standard input and send to standard output is utilized by a shell feature called pipelines. Using the pipe operator
| (vertical bar), the standard output of one command can be piped into the standard input of another.
To fully demonstrate this, we are going to need some commands. Remember how we said there was one we already knew that accepts standard input? It’s
less. We can use
less to display, page by page, the output of any command that sends its results to standard output:
ls -l /usr/bin | less
This is extremely handy! Using this technique, we can conveniently examine the output of any command that produces standard output.
Pipelines are often used ...