Last Updated: February 25, 2016
·
8.515K
· marchibbins

Exclude directory from grep, e.g. .git, .svn

Using GNU grep:

grep --exclude-dir=".git"

3 Responses
Add your response

I tend to use ack. It's a great tool - definitely worth a look.

https://metacpan.org/module/PETDANCE/ack-1.96/ack-base

over 1 year ago ·

Seconding ack - it does things like this that you'd just want without having to be told about it. Ack is far nicer to use than grep, IMO.

over 1 year ago ·

git grep solves the specific problem rather well

over 1 year ago ·