Skip to content

Instantly share code, notes, and snippets.

@marcusshepp
Last active November 21, 2017 18:48
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 marcusshepp/7f2d13d0d727c6be5612d07b655187cf to your computer and use it in GitHub Desktop.
Save marcusshepp/7f2d13d0d727c6be5612d07b655187cf to your computer and use it in GitHub Desktop.
grep
grep "4294" -B 3 -A 3
grep -r "foo" .
# -H causes the filename to be printed (implied when multiple files are searched)
# -r does a recursive search
# -n causes the line number to be printed
# -I ignore binary files (complement: -a treat all files as text)
# -F treat search term as a literal, not a regular expression
# -i do a case-insensitive search
# --color colors the seached string
# --include \*.js to limit search to a specific file extention
grep -HrnIFi --exclude-dir=.git "foo" app/
grep --color -rIF --include \*.js dbPromotion app/scripts/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment