App::Ack
One tool I make heavy use of during development is ack. It is a grep replacement that is optimized for searching through source code, and it has been a great help to me for when I needed to dig through the koha code.
Acks strength is in its really useful set of default behaviors. Unlike grep, its default is to recurse through your directories while simultaneously ignoring backup files, core dumps, and source control directories like RCS, CVS, .svn, etc. Technically, you could do this with grep, find, and lots of command-line options, but getting the right incantation might take some trial and error.
Ack condenses all that into 3 easily-typed letters and then gives you a bit more. One nice touch is that it can use color to highlight matches that it finds, but if it notices that it’s output is being sent to a pipe, it’s smart enough to disable color. You can also use it to only look through files of the types you care about. For example, if you wanted to only search through your css and javascript files for the string ’sidebar’, you’d type:
ack –js –css ’sidebar’
There’s also a really handy vim plugin for ack that lets you search through your source tree from within vim. The search results are presented to you inside a :copen window and you can move backwards and forwards through the list of results using the :cprev and :cnext commands.
I like it a lot, and I recommend giving it a try if you haven’t already. It certainly makes searching through large codebases a lot easier.
_ /| \'o.O' =(___)= U ack --thpppt!
