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.
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
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 🙂