A User-Friendly Command Line Shell .. (Yup, For Real!)

ubuntu karmic koala

This guide & cheatsheet – using simple memorable commands, not complex syntax – will make you not only faster at the Linux shell, but enjoy it too.

Copying over my old bashrc file to a new install (it lives in your /home/username folder) is the first thing I do because it speeds up and simplifies everything else .. especially for someone with a memory as bad as mine. So what is bashrc?

Here's the thing: such is Linux, to make the most of it, we use the terminal a whole lot. Not that you have to – you can get away without, but that's like drinking non-alcoholic beer. Hic.

To make the command line experience way faster, less dour, more powerful, even fun, we edit the bashrc file.

Setup Unmanaged VPS (4 Noobs!) ... with vpsBible
Secure WordPress. Properly. ... with wpCop, the platform's dedicated security website
Olly 'the_guv' Connelly's vpsBible.com site and 'WordPress 3 Ultimate Security' book.


.. and prompted, give the password you created at the Ubuntu installation stage, if any.

Scroll to the bottom of the file and paste whatever you fancy from below, modifying the aliases to suit you. I've made comments beside the “###heading” for each section to clue you in:-

The way these work is pretty self-explanatory but, to break down an example, this one is the shortcut to open this file, bashrc, for when we want to add more cool ‘cuts:-

  • alias ebrc tells bashrc we're issuing an alias directive, and that the alias itself will be “ebrc” (it could be mostly anything you like)
  • = well, it's an equal sign, obviously!
  • “nano ~/.bashrc” is the quoted, properly syntaxed command we would normally provide

So, instead of issuing nano ~/.bashrc, now all we need type is ebrc.

That won't work though, until we restart bashrc, by typing:-

source ~/.bashrc

As you may have seen, I've even shortcut the command to restart bashrc. Having set an alias to restart bashrc – ebrcupdate – and restarted bashrc one last time with it's regular restart command, source ~/.bashrc), thereafter I type ebrcupdate.

You may imagine, this bash thing is darnedly handy, especially when maneuvering about remote servers where you also have a jazzed up bashrc. I log into the server for this site, for example, with this command:-

And if I want to open my SOCKS proxy, depending on where I want to pretend to be, I just type:-

.. or ..

How handy is that? Especially for a bloke like me who, like I say, can barely remember the, er .. can't recall what I was gonna say there.

Got a personal favorite, or ten? Please share. I'll add the ones that aren't shortcuts to Viagra online.


About the Author:

Olly Connelly (yeah, that's me) blogs at guvnr.com, polices WordPress security at wpCop.com and helps noobs build web servers at vpsBible.com, so if you've got sleeping problems you know where to come.

Add a Comment