|
Web Contractors Web Developer Jobs Join Us / Log in Discussion |
Ingoring .svn files with grep
If you're using a software respository like Subversion and you're having hassle with your repo files turning up in your Grep searches then there are a couple of things you can do to tidy this up.
Searching with the -v option removes that pattern from the search. So something like this will exclude all the .svn files from your grep search results:
grep -r mystring mypath | grep -v .svn
or using the --exclude option as is says in the grep man page.
"
--exclude=GLOB
Skip files whose base name matches GLOB (using wildcard matching). A file-name glob can use *, ?, and [...] as wildcards, and \ to quote a wildcard or backslash character literally.
"
grep -r --exclude=\*.svn\* mystring mypath
But an edit to your .bashrc file like this will exclude .svn from grep searches them forever!
Just open your .bashrc file and stick this at the top:
GREP_OPTIONS="--exclude=\*.svn\*"
export GREP_OPTIONS
New forum topics
- Crystal Reports developer needed
- web applications/ e-commerce/ web marketing
- Freelance web developers team with great prices
- designer in need of developer
- SOAP (PHP, MySQL) Programmer/Developer
- Ruby on Rails Mac OS X - Leopard
- Freelance Web developer wanted
- Ringtone fatigue
- web developer looking for more project
- PHP website maintenance
- Desk available for hire - Rushcutters Bay location
- ZAMP?
- Don't hack the Drupal Core. Make a patch!
- What to charge for site updates
- Start New Website or CMS business. Business Partner / designer


Yeh
Noice!
Post new comment