Skip to main content

13.5) Many Commands


To isolate the line with a ‘6’ in it from the above, use another pipe:

grep 5 file7 | grep 3 | grep 6

You can then continue this as much as you like, e.g.

grep 5 file7 | grep 3 | grep 6 | grep 5 | grep 4 | grep 3 | grep 6

This illustrates that you can use pipes to join up Unix command. Many commands can be used with pipes. Also, you can always save the results of this series of commands by using a redirection at the end to save the final results to a file.