Skip to content

Instantly share code, notes, and snippets.

@alexzhan
Created November 4, 2011 08:40
Show Gist options
  • Save alexzhan/1338938 to your computer and use it in GitHub Desktop.
Save alexzhan/1338938 to your computer and use it in GitHub Desktop.
grep搜索同时包含多个关键字的文件
grep -nirl ‘xxx’ ./ | xargs grep -Hnir “yyy”
命令的前半截先列举出包含’xxx’关键字的文件路径和文件名。后半句在这些文件中搜索’yyy’关键字并列出。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment