Last active
July 26, 2018 00:59
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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