我希望能够使用我的第一个grep语句获取我找到的文件,例如:grep -r Makefile*然后将grep传递中找到的文件传递给第二个grep,例如: grep {files}'-lfoo'
我该怎么做呢?我知道必须有办法.
谢谢.
grep -l firstmatch * | xargs grep secondmatch {}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2690 次 |
| 最近记录: |