Skip to main content

13.7) Using Pipes


We can’t search all possible combinations but you can do the grep command twice to get a likely unique answer in this case. So first run:

grep ‘JJP’ *

and this will find all files that have ‘JJP’ in them. Then pipe this result to another grep command that searches for the number ‘800’, so:

grep ‘JJP’ * | grep ‘800’

This will identify all lines that have ‘JJP’ and the subset of those that have a number ‘800’ as well.