Skip to content

Instantly share code, notes, and snippets.

@DavidMetcalfe
Last active April 19, 2018 23:19
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 DavidMetcalfe/25fd3c876bab0acc18a4e9b865a6b784 to your computer and use it in GitHub Desktop.
Save DavidMetcalfe/25fd3c876bab0acc18a4e9b865a6b784 to your computer and use it in GitHub Desktop.
Recursively search through files in chosen directory
# -r = recursive
# -n = line number within file
# -w = match whole word
grep -rnw . -e 'query' # Search current dir in bash.
grep -rnw '/path/to/directory/' -e 'query' # Search provided directory in bash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment