Skip to content

Instantly share code, notes, and snippets.

@shazron
Created November 28, 2019 17:14
Show Gist options
  • Save shazron/a5bc7abce9869007ff62f40ab7402327 to your computer and use it in GitHub Desktop.
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
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