GREP a subversion tree

If you use grep like me to find or navigate around source code that you recently grabbed via Subversion, you may find this useful:

Put this in your .bashrc file:

export GREP_OPTIONS=”–exclude=*.svn*”

Then when you run grep in a subversion tree…it will exclude all of the .svn directories. Or if you don’t wish to make this change permanent, simply use:

GREP_OPTIONS=”–exclude=*.svn*” grep -r <<something to find in files>> *


2 responses to “GREP a subversion tree

  1. I’ve used SVN but i’m an idiot in Linux/Unix env.
    Hahah and I’ve heard about GREP…never really use it before. I just know there’s a pretty nice function called “BLAME” 😛

  2. Please fix the quotes to not be directional.
    export GREP_OPTIONS=”–exclude=*.svn*”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s