7nylkw
Last Updated: February 25, 2016
·
4.462K
· marchibbins

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

Using GNU grep:

grep --exclude-dir=".git"

3 Responses
Add your response

3204

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 ·
3252

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 ·
11280

git grep solves the specific problem rather well

over 1 year ago ·