ack 2.24 is released, speeds up common cases

June 21, 2018 ack No comments

I’ve just uploaded a new version of ack, version 2.24, to the CPAN and posted it to

This version of ack introduces an optimization to not search most files line-by-line until after ack has read the whole file and determined that the pattern matches in the file at all. This speeds things up quite a bit. Here are some timings in seconds for acking against the Drupal codebase. It compares ack 2.22, the just-released 2.24 and the latest beta of ack version 3:

                                    |   2.22 |   2.24 | 3 beta
          ack zqj /home/andy/drupal |   1.93 |   1.53 |   1.46
ack zqj-not-there /home/andy/drupal |   1.85 |   1.50 |   1.45
          ack foo /home/andy/drupal |   1.99 |   1.66 |   1.62
       ack foo -w /home/andy/drupal |   1.94 |   1.63 |   1.57
  ack foo\w+ -C10 /home/andy/drupal |   4.54 |   2.13 |   1.97
ack (set|get)_\w+ /home/andy/drupal |   2.01 |   1.79 |   1.79

Of course ack doesn’t have the raw speed of a tool like ripgrep, but it’s got a different feature set. See this feature comparison chart of greplike tools for details.

The best open source project for someone might not be yours, and that’s OK

January 2, 2018 ack, Open source 1 comment , , , ,

If you work on an open source project, consider helping your users by pointing them to other “competing” projects that might be better choices for them.

You may be familiar with ack, a grep-like code searching tool that I created in 2005. Over the years, a number of similar tools have come along, with the two most prominent being ag and ripgrep.  I just published a chart that compares the features of ack, ag, ripgrep, git grep and plain ol’ GNU grep.

Some might say that ag and ripgrep and any of the other tools I list on are competing projects, but I think that way of thinking is wrong.  It’s only a competition if you see it as a competition.  I’m not competing against anyone for anything: Clicks, dollars, popularity, etc. If someone uses ripgrep instead of ack, it doesn’t hurt me.  It’s the difference between an abundance vs. scarcity view of the world.  I choose abundance.  I think most of us who work in open source do, too.

When I created ack, I created a tool that was useful for me.  After a while, I figured that others might find it useful as well.  I released it publicly and people loved it.  People wrote things like “ack is certainly one of those simple pleasures of life on the command line”, and they told me it made their lives easier.  Great!  That’s why I released it.

Other people have told me “I don’t need that, I can just use standard Unix tools”.  That’s great, too, if that’s what you need.  Sometimes when they tell me that, it seems like they’re expecting me to argue or be upset.  But why would I?  It doesn’t matter to me what tool you use so long as you’re happy with it.

Now, other tools have sprung up that do grep-like things that fit different needs, and drop features their authors didn’t find necessary.  I love that there are so many tools out there.  Maybe some day someone will create a tool that fits my needs better than ack does.  If that day comes, I’ll pass ack off to someone else, and I’ll use the new tool, and I’ll love it.

If you have a project, you probably know about the other projects that exist better than anyone else.  You’re keeping an eye on similar projects to see what features they’re adding and what people are saying about them.  Now, take that knowledge and help others by sharing it with them.

It might mean that a potential user of your project uses someone else’s project, and that’s just fine if they do.  Happy users are why we should be doing this.

Do you know of other projects that do this sort of comparison chart, or otherwise help potential users learn about “competing” projects with honest comparisons?  Please let me know in the comments below, or email me at

ack 2.0 has been released

April 19, 2013 Open source, Programming, Unix 6 comments ,

ack 2.0 has been released. ack is a grep-like search tool that has been optimized for searching large heterogeneous trees of source code.

ack has been around since 2005. Since then it has become very popular and is packaged by all the major Linux distributions. It is cross-platform and pure Perl, so will run on Windows easily. See the “Why ack?” page for the top ten reasons, and dozens of testimonials.

ack 2.0 has many changes from 1.x, but here are four big differences and features that long-time ack 1.x users should be aware of.

  • By default all text files are searched, not just files with types that ack recognizes. If you prefer the old ack 1.x behavior of only searching files that ack recognizes, you can use the -k/--known-types option.
  • There is a much more flexible type identification system available. You can specify a file type based on extension (.rb for Ruby), filename (Rakefile is a Ruby file), first line matching a regex (Matching /#!.+ruby/ is a Ruby file) or regex match on the filename itself.
  • Greater support for ackrc files. You can have a system-wide ackrc at /etc/ackrc, a user-specific ackrc in ~/.ackrc, and ackrc files local to your projects.
  • The -x argument tells ack to read the list of files to search from stdin, much like xargs. This lets you do things like git ls | ack -x foo and ack will search every file in the git repository, and only those files that appear in the repository.

On the horizon, we see creating a framework that will let authors create ack plugins in Perl to allow flexibility. You might create a plugin that allows searching through zip files, or reading text from an Excel spreadsheet, or a web page.

ack has always thrived on numerous contributions from the ack community, but I especially want to single out Rob Hoelz for his work over the past year or two. If it were not for Rob, ack 2.0 might never have seen the light of day, and for that I am grateful.

A final note: In the past, ack’s home page was With the release of ack 2.0, I’ve changed to “Beyond” feels less adversarial than “better than”, and implies moving forward as well as upward. also includes a page of other tools that go beyond the capabilities of grep when searching source code.

For long time ack users, I hope you enjoy ack 2.0 and that it makes your programming life easier and more enjoyable. If you’ve never used ack, give it a try.