Archive for June 20th, 2007

You are currently browsing the archives of HidayahTech .

Using find & grep to search subversion working copies

Alhamdulillaah, I was able to write a very simple bash function that will efficiently scan an entire directory tree for files which contain a string and display those lines, along with line numbers, and highlight the searched term in the terminal. The result can be found below:

function search
{
    time find . -name '.svn' -prune -o -exec grep -inH --color -e "$1" '{}' ;
}

The search function takes as its only parameter the string for which you are searching. Three standard *nix programs are utilized – time, find, & grep.

Continue Reading »

Posted by Basil on Jun 20th 2007 | Filed in Development, GNU/Linux, Subversion | Comments (0)

Creative Commons Attribution-ShareAlike 3.0 United States
Creative Commons Attribution-ShareAlike 3.0 United States