Posted on 3 Comments

Tool of the day: ack – better than grep

I’m decently familiar with grep so I can usually make it do what I want. I frequently need to search for instance MySQL source code for certain pattern strings, and this makes life so much easier. But Akash pointed out ack to me, which has the specific tagline “better than grep” (has the domain even) and I reckon it does live up to that. Win! It’s written in pure Perl, very easy to install (doesn’t even use CPAN if you don’t want).

It recurses into subdirs by default, while ignoring stuff like revision control and binary files. You can search specific types of files through a symbolic name rather than by specifying regexes. And it has colour highlighting, and simply uses the familiar Perl regexes for its pattern matching rather than funky subsets of which there are many distinct ones…

Posted on 3 Comments

3 thoughts on “Tool of the day: ack – better than grep

  1. “agrep” is a much better grep than grep too.

  2. Hmm, GNU grep on my Linux box recurses into subdirectories by using the “-r” option. And using “–color=auto” gives me colour highlighting, too 🙂

    But thanks for the hint, ack might come in handy for some purposes…

Comments are closed.