Install ack on Ubuntu

If you are developer and a *nix OS user you probably already know how useful the grep command is. I’m using it almost all the time while I’m working, because it’s really useful and saves me time during the development and debugging process.

A while ago Mario Peshev told me about ack. I decided to give it a try to I think it is better than grep because it’s shorter and it’s easier to use.

Anyway, the reason I’m writing this post is that I found that Ubuntu is using the ack package for something else. So you need to install the ack-grep package, instead of ack.

How to install ack on Ubuntu

sudo apt-get install ack-grep

On Debian-derived distros, ack is packaged as “ack-grep” because “ack” already existed. Your ack will be called “ack-grep”, which is 167% more characters to type per invocation and this is tragic for your poor fingers.

I couldn’t think of where I read this, but it was pretty good 🙂

So, now we have ack-grep installed, but the whole idea is to use something shorter and faster. What we can do is to

Rename ack-grep to ack

To create a local diversion, renaming ack-grep to ack, first install the ack-grep package as shown above and then run:

sudo dpkg-divert --local --divert /usr/bin/ack --rename --add /usr/bin/ack-grep

ack on Ubuntu shell-lite

If everything is went well, you should be able to use the “ack” command in your Terminal and I’m sure you will increase your productivity. Happy ack-ing 🙂

Stanko Metodiev is a WordPress veteran and the CTO of DevriX. For the past 12 years Stanko has been developing complex SaaS platforms, multisite solutions, migrating various systems to WordPress, managing a team of developers and leading a few key international projects in the company. In the past years, Stanko is the lead organizer of the WordPress Sofia User Group (WPBGUG) and has been a part of the organization of WordCamp Sofia and WordCamp Bulgaria. In his portfolio, you can find free themes and plugins on, and badges of his membership in the WordPress support, polyglots, theme reviews teams. Stanko is a fan of Real Madrid and often watches football games in shisha bars with friends and with his family at home. Also an avid fan of Counter-Strike and an active member of the remote work culture worldwide.

Tagged with: , ,
Posted in Linux, Tips and Tricks

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

A proud DevriX team member

WordPress Development agency building complete solutions for successful businesses.

WordPress Core Contributions
  • [49216] Bundled Themes: Import Twenty Twenty-One, the new default theme for ...
  • [43345] I18N: Remove unused MediaElement.js strings. Props metodiew. See ...
  • [42160] About: Fix grammar typo with pluralization. Props metodiew, ...
  • [42159] About: Fix grammar typo with pluralization. Props metodiew, ...
  • [41339] Widgets: Use `word-wrap: break-word` for available widget ...

View all 15 tickets on Trac.

Recent Posts
Recent Comments