Search code examples
linuxarchlinuxack

Why can't I run ack from the terminal after I switched from ubuntu to archlinux?


I just switch from ubuntu to archlinux and I installed ack-grep via pacman. However what I found is I can't run $ ack from terminal directy. I have to type $ perl ack , which is a pain...I wonder if anyone hve experienced similar situation and how do you solve it.

Thanks


Solution

  • It depends on the shell you're using. Probably the simplest thing you can do (assuming bash) is to create an alias for your desired command, something like:

    alias acx='perl ack'
    

    You'll probably want to place that somewhere in one of your startup scripts, such as .profile, or .bash_profile in your home directory.

    If you're using a different sheel that doesn't support aliases, you can still resort to providing a script to do the translation for you, such as putting the following acx file in your path:

    perl ack "$@" # or however your particular sheel transfers all arguments.