Skip to content

bash Wednesday – alias

One of the best tips I can give on using the command line to your advantage is to grab a hold of the “alias” command. You’re going to be typing a lot of commands, and with Ubuntu, through the bash shell’s glorious “alias” command, they’ll be fewer and shorter.

The alias command allows a shell user to provide their own set of alternate commands for commonly keyed instructions.

The default install of bash includes a few basic aliases, some different modifications of a regular listing of files. Try “ll” for example. While it’s not a command included in Ubuntu and no binary exists for it, the command still provides a more verbose listing of the files. That’s because bash has already defined that alias for you (unless you’ve removed it).

I use the command to make it easy to start and stop my mail server.

alias fymail='vmware-cmd /home/vmware_machines/fymail/fymail.vmx'


Afterwards,

I can use

fymail start

or

fymail suspend

It may take a little practice and some experimenting, but they save me a lot of time and keystrokes.

You’ll want them to load in your startup of course, so I suggest using

gksu gedit ~/.bashrc

to save your alias commands for future sessions.

Google Buzz

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*