The “alias” command

Alias: Speed Dial for your Shell

By Gary Richmond

Online on: 2007-09-24

You almost certainly have speed dial set up on your home, office and mobile phone. It saves time, ensures against a failing memory and allows you to work smarter.

Devotees of the command line don’t have to be left out in the cold. One of the crown jewels of GNU/Linux is that every user, be he ne’er so base, has at his or her fingertips the kind of power of which even Caligula could not dream. Alright, I’m exaggerating—a little.

GNU/Linux comes with many commands and you use them every time you open a console and interact with it through the shell. The Bash shell (often described as the great grandaddy of all shells or, less flatteringly, as “an historical wart on the Bourne shell”) comes as standard with virtually every version of GNU/Linux and there are others too: Fish, Korn and Zsh. Whether you are listing file contents, configuring your wireless card, copying, deleting or moving files or appending arguments to built-in commands you are utilizing those features.

The built-in command I want to look at is alias. (If you want to be technical, alias has been defined as a “parameterless macro” and is not to be confused with IP aliases, a process for adding more than one IP address to a network interface.) It is a perfect example of a command that is simple yet useful and its use is restricted only by your knowledge of the Unix commands and the capacity of your imagination to exploit it. It is probably at this point that you might want to sit down and think about working faster by working smarter. In short it’s time to get out your pencil and paper and start making a list of all of those commands (and composites thereof) that you use most frequently and see if you can’t make them more compact. In the process you will not only work more efficiently; you will have increased your knowledge of the GNU/Linux commands and file system.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s