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 technical lead and a Project Manager at DevriX. Here is also a WordPress Core contributor, themes and plugins author and occasional speaker.

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.

DX GitHub Badge
WordPress Core Contributions
  • [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 ...
  • [38892] Twenty Seventeen: Resolves the pin icon having variations This fixes ...

View all 14 tickets on Trac.

Recent Posts
Recent Comments
Archives
Categories