Skip to content

Instantly share code, notes, and snippets.

@lirenlin
Last active December 24, 2015 00:19
Show Gist options
  • Select an option

  • Save lirenlin/6716022 to your computer and use it in GitHub Desktop.

Select an option

Save lirenlin/6716022 to your computer and use it in GitHub Desktop.
More grep search options
grep -R --include="*.txt" "pattern" /path/to/dir
grep -R --include=*.{c,h} "pattern" /path/to/dir
grep -R --include="*.c" --include="*.h" "pattern" /path/to/dir
-R recursively
-i ignore case
-n show line number
--include "pattern"
--exclude "pattern"
--color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment