I was just wondering, i recently installed ack (ack-grep in ubuntu), and i can't figure out how to just type in ack to get ack-grep (for some reason ack is taken up by a kanji translator thing).

Is there a better way than just aliasing the thing in the shell (it is not global that way, and cannot evoke it in vim for example).

Thanks a lot!

link|improve this question

67% accept rate
feedback

5 Answers

up vote 4 down vote accepted

You link or copy ack-grep to /usr/local/bin so that it gets prioritary in the PATH:

sudo ln -sf /usr/bin/ack-grep /usr/local/bin/ack

Or, like davey suggested, get rid of ack if you don't need it:

sudo apt-get remove ack

Another solution would involve using dpkg-divert to tell dpkg that you want all packages to have their /usr/bin/ack renamed locally and then link ack-grep to ack in the path.

link|improve this answer
feedback

The easiest thing to do is install ack via cpan. It will get installed in /usr/local/bin, which has precedence over /usr/bin. Just run:

sudo cpan App::Ack

or if you don't have the cpan client:

curl -L cpanmin.us | perl - --sudo App::Ack
link|improve this answer
Didn't work for me on Ubuntu 10.04 LTS. Error message: "Don't be silly, you can't install daniel bosold". But sudo cpan -i App::Ack does. – geekQ Oct 10 '11 at 8:48
Thanks. Fixed now. – Naveed Oct 17 '11 at 2:51
feedback

In Ubuntu/Debian you can "divert" ack-grep:

sudo dpkg-divert --local --divert /usr/bin/ack --rename --add /usr/bin/ack-grep
link|improve this answer
feedback

Assuming that the kanji translator is not already /usr/bin/ack and that its location is later in your path than /usr/bin, then you can probably do this:

sudo ln -sib /usr/bin/ack-grep /usr/bin/ack

This will prompt you to confirm the operation if the destination exists and creates a backup if you select yes.

link|improve this answer
1  
Unfortunately the kanji ack lives in /usr/bin so if you can live without it: sudo apt-get remove ack – davey Dec 25 '09 at 8:23
feedback

Least obtrusive:

alias ack=ack-grep

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.