It's easy enough to imagine a trivial use of . For example, whenever the output of a command is longer than will fit on a single screen, you might want to pipe to a pager program such as , which shows the output a screenful at a time, and waits for you to press a key before it shows the next screen. If you were a writer like me, and wanted to check each "which" that you wrote to find out if any of them should have been "that," you might use the search program and type:
(Article 13.1 has more about pipes.) more lets you see the output a screenful at a time.
However, if you want to see how pipes can be really useful, you need to be a little more ambitious, or maybe just have a more specialized problem.
.XX "topic, subtopic"
When the document is printed, the formatting package collects these entries, adds page numbers, and assembles the index. It is important that all entries be consistent. For example, if at one point the user makes the entry:
.XX "Indexing, introduction to"
and at another point:
.XX "Index, introduction to"
the program will generate two separate entries rather than merging them into one entry with two page references.
In order to check the consistency of index entries, one could enter the following command:
In this command, files is a list of the files to be checked. grep searches through that text for a specified string or pattern.  puts the lines selected by grep in alphabetical order and removes duplicate lines.
The pipeline is started with the
This is a very specific - and normally very tedious - job that needs to be done. And because UNIX provides general-purpose tools and an easy way of using them together in a kind of assembly line, you are provided a relatively simple way to get the job done.
"Ugh!" you say, "That's just what I hate about UNIX. All these long filenames and options I can't remember. Who wants to type all that stuff!"