agrep - find stuff - FAST
I have no idea how often I used Windows Explorer’s “Search …” option to try to locate files with a certain keyword in them. Right-click on a directory, select “Search …”, fill in filename as “*.*” and then provide the search text. Explorer is going out and looking at all the files in the specified directory and its sub-directories and quite often returns with an empty search result: it claims that none of the files in the directory tree contained the keyword I was looking. However, I *know* that there’s at least one file that contains the keyword, otherwise I would not be looking for it.
Today I (re-)discovered “agrep”. “Agrep” is a variant of the Unix-utility grep. It adds some nifty features over the standard grep and there are versions for virtually every platform. To look for the string “revisionHistory” in all files and sub-directories, you would enter the following in the starting directory:
c:/some/directory/> agrep -r revisionHistory *
Pretty quickly, agrep will spit out a list of all the files that contain the keyword (unlike Windows Explorer’s “Search …” function).
What sets “agrep” really apart from the other search/grep-implementations: it can do “fuzzy” searches, which means that it will also find words that are close to the one you’re looking for. Add a “-number” argument and will also find matches that are “number” characters away from the word you specified. So if I specified “-2″ and somebody had a typo in a file turning “revisionHistory” into “revisionHitsory”, agrep will find it and spit it out as well.
The wikipedia-article above will bring you to all the places where you can download a version of “agrep”. It’s old, but it’s still as useful as it was a few years ago.
I gave up on Windows Search quite a while ago (prefer to keep indexing turned off). I purchased the third-party search tool called Avafind, and have been quite happy with it. I find deeply-buried files in mere seconds, with very little typing.