...
Info |
---|
|
...
Redirection of output: > vs >>
...
Info |
---|
Over the next set of examples we will pipe (using the “|” character) together a series of commands that will “generate a file that contains a sorted list of unique terms that include the sub string |
Code Block |
---|
[intro_to_linux]$ cat fruits.txt Gooseberry Apple Apricot Avocado Strawberry ... [intro_to_linux]$ cat fruits.txt | wc -l 97 |
Info | ||
---|---|---|
We could use the
|
...
Example continued
Info |
---|
First step, find all the terms that contain the sub string |
...
Code Block |
---|
[intro_to_linux]$ cat fruits.txt | grep berry | sort | uniq > berries.txt [intro_to_linux]$ cat berries.txt Bilberry Blackberry Blueberry Boysenberry Cloudberry Cranberry Elderberry Goji berry Gooseberry Honeyberry Huckleberry Juniper berry Marionberry Mulberry Raspberry Salal berry Salmonberry Strawberry [intro_to_linux]$ cat berries.txt | wc -l 18 |
Info |
---|
|
Note |
---|
You might also be presented with a long pipeline/list of commands separated by the Now you know how to separate this pipeline into individual steps, dissecting by the |
...
Example: Pipe from ls command
...