December 10, 2007
Ack, A Code Searcher
Ack is a tool for programmers similar to grep but made for heterogeneous source code trees. What I was impressed with upon downloading and installing it was the highlighting it does all in the terminal.
I’ve used it a few times searching through rails trunk as TextMate seems to dog when you get a bunch of files in one project. It also prominently displays the file path which you can then copy and open with the mate command.
A few reasons you might want to use ack (from the ack site, there are more there as well):
- it’s really fast
- it runs on windows
- the standalone version has no dependencies so you can throw it in ~/bin
- searches recursively through directories by default, while ignoring .svn, CVS and other VCS directories
- let’s you specify file types
$ ack --perl pattern
Installation is really easy on a mac. Just grab the standalone version and throw it in ~/bin/ack. Note: make sure that it is executable (
chmod u+x) and that ~/bin is in your path. Enjoy.
Update: Ack can now be used in textmate with a bundle