Tuesday, August 19, 2008

Aliases

Aliases are ways to simplify a command to one word. (Sometimes, moving a script to /usr/bin will accomplish the same thing). To setup an alias, you need to add it to ~/.bashrc (i.e. /home/user/.bashrc). It seems /etc/bash.bashrc might also work (see sources listed below). To add it to .bashrc, do the following:
1. Bring up .bashrc for editing with the following command:
sudo gedit /home/user/.bashrc
Note that user = your user name
2. Add an alias to the file and save. The syntax for an alias is the following:
Alias nickname='command'
For example, you might have something like this-
Alias songbird='/opt/Songbird/songbird'

Sources:
Lifehacker-Ten Handy Bash Aliases
Ubuntu-Environment Variables (explains why .bashrc is used)

No comments: