开发者

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?

开发者 https://www.devze.com 2022-12-30 21:01 出处:网络
I want to be able to take the files I found with my first grep statement, something like this for example:

I want to be able to take the files I found with my first grep statement, something like this for example: grep -r Makefile * And then pass the files found in that pass of grep to a second grep with something like this for example: gre开发者_JS百科p {files} '-lfoo'

How do I do this? I know there must be a way.

Thank you.


grep -l firstmatch * | xargs grep secondmatch {}
0

精彩评论

暂无评论...
验证码 换一张
取 消