Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Last active July 26, 2018 00:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YumaInaura/57cbca6355de53f5a1cfa85928dc960a to your computer and use it in GitHub Desktop.
Save YumaInaura/57cbca6355de53f5a1cfa85928dc960a to your computer and use it in GitHub Desktop.
Find files and grep all patterns in multiple files with Linux shell commands
find ./ -name "*.txt" | xargs -I % sh -c 'grep first_text >/dev/null "%" && grep second_text >/dev/null "%" && echo "%"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment