Stefan Hayden

Alt + Ctrl + X

Exclude svn files from grep

Grep is confusing enough and does not need to be even harder to use. SVN files are almost always not wanted in a search and just make finding what you want even harder. Luckily you can set a default option.

First jump in to the .bashrc file in your home directory.

nano ~/.bashrc

Then add the options for grep in that file:

GREP_OPTIONS="--exclude=*.svn-base"
export GREP_OPTIONS

Now save and exit the file. Before it will work you need to either restart the session or enter this in the console:

source ~/.bashrc

Wave goodbye to all those pesky svn file.

2 Comments
Gravatar

Hi, thanks. Useful post, I’ll be easier to find search results without all those svn-base files ;)

Gravatar

Thanks Mr. Hayden! That was extremely helpful for navigating this large, unfamiliar codebase checked out of SVN.

Feed Icon Comment Feed

Post a Comment