开发者

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 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜