PHP Developers Network
http://forums.devnetwork.net/

Grep -- how do I ignore .svn directories?
http://forums.devnetwork.net/viewtopic.php?f=30&t=91535
Page 1 of 1

Author:  alex.barylski [ Mon Dec 01, 2008 12:18 am ]
Post subject:  Grep -- how do I ignore .svn directories?


Author:  VladSun [ Mon Dec 01, 2008 4:09 am ]
Post subject:  Re: Grep -- how do I ignore .svn directories?


Author:  alex.barylski [ Mon Dec 01, 2008 8:28 pm ]
Post subject:  Re: Grep -- how do I ignore .svn directories?

Dude...your the man. 8)

Awesome...but I assume $where is project path?

Killer stuff...thanks again :)

Author:  Chris Corbyn [ Sat Dec 06, 2008 5:38 pm ]
Post subject:  Re: Grep -- how do I ignore .svn directories?

I usually just do this:

Syntax: [ Download ] [ Hide ]
grep something /path | grep -v .svn


grep does have an --exclude=pattern option too.

Author:  VladSun [ Sat Dec 06, 2008 8:17 pm ]
Post subject:  Re: Grep -- how do I ignore .svn directories?

It's a too much resource consuming solution ;)
I mean - grep for a text is slower than pre-excluding directories not to be searched by using find.

And I'm not sure whether the --exclude=PATTERN option will match against full path string or file name string.

Author:  bottomless [ Wed Mar 31, 2010 7:44 pm ]
Post subject:  Re: Grep -- how do I ignore .svn directories?

Use a recent version of grep (2.5.3 or better) so you can use the --exclude-dir switch that does work as expected:

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/