linux - How do I pass the resulting files from one grep pass to another so that I only grep through the subset with the second pass? -


I want to be able to take the files I got with my first grep statement, for example something like: grep -r Makefile * and then grep files that have been found nearby for some other way: grep {files} '-lfoo'

How do I do this? I know that should be a way.

Thank you.

  Grep -l firstmatch * | Xargs grep secondmatch {}  

Comments