Open the configuration file for your shell in a text editor. From the GNOME desktop, for example, you can press ALT+F2, and in the Run dialog box type gedit .bashrc.
Then, just type alias shortcut='command'. There are a couple of examples below.
With the ls command, you can add the -l or -a options to display more information. Instead of using five keystrokes, you can cut it down to two with the following aliases:
alias ll='ls -l'
alias la='ls -a'
I maintain two Web sites, and often securely log into the servers using the ssh utility. The command that I use looks something like this:
ssh myID@www.mysite.com
Instead of typing all of that, I created aliases for logging into the servers for each site that I maintain, cutting the number of keystrokes that I need to type, down to five from over 20.