One of the handiest tools in my programming toolkit is
ack, a Perl script that is great for searching through code (or really any text files). I use it a lot while refactoring, for example when I want to rename a method every time it’s called in a project.
ackwith this command (from http://betterthangrep.com/):
$curl http://betterthangrep.com/ack-standalone > ~/bin/ack && chmod 0755 ~/bin/ack
~/bin/ack is in your path searching code is as easy as this:
$ ack my_poorly_named_method