Created
November 28, 2019 17:14
-
-
Save shazron/a5bc7abce9869007ff62f40ab7402327 to your computer and use it in GitHub Desktop.
Recursively find files of a certain filename, and search for a string in the file. Exclude folders such as node_modules
This file contains hidden or 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 . -type d -name FOLDER_TO_EXCLUDE_FROM_SEARCH -prune -o -type f -name FILENAME_TO_FIND -print | xargs grep PATTERN_TO_SEARCH_IN_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment