Skip to content

Instantly share code, notes, and snippets.

@marcusshepp marcusshepp/grep.sh
Last active Nov 21, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.