Smart grep with SVN
Monday, March 7, 2011 EST (Updated on: Wednesday, August 3, 2011 EDT)
by: Eric Potvin
Looking for code in PHP files with grep is great! Grep is one of the best command of Linux to find what you need quickly.
But if you are like me, you don't want to see what's in the SVN repository hidden folder and/or the smarty cached files.
To remove SVN repository files, you need to add to the grep:
grep -v "\.svn"Now to remove the smarty files:
grep -v %%Now let's add some color (mandatory):
grep "search_criteria" --colorNow the final command:
grep -r "search_criteria" /home/user/path/* | grep -v "\.svn" | grep -v %% | grep "search_criteria" --color
Be the first to reply!
Share this article: