w w w . T H E B I T S . c o . u k


Any Way To Shorten All Those Huge Commands?!

Home Contents Previous Next

Very similar to the last section, this is a very handy way of shortening all those huge commands you use regularly.

- 1 -

Log-on as 'root' and enter:

cd /etc

- 2 -

Enter:

pico bashrc

- 3 -

Now enter the following line at the bottom of the text file:

alias x='startx'

- 4 -

Press Ctrl+o to save the file and then Ctrl+x to exit Pico.

- 5 -

Still in the '/etc' directory, enter:

source bashrc

...to activate the changes you've made.

- 6 -

Now whenever you enter:

x

...you start up X Windows! (instead of the longer 'startx').

Useful, and something to show-off to your mates, but not exactly the greatest time-saver in the world. So what's the point? The point is you can use any alias you want, for ANY command! Here's one I use (a great time-saver, I'm sure you'll agree):

alias izip='mount /dev/hdc4 /mnt/zip -t vfat'

...so that everytime I enter 'izip', I mount my internal Zip drive to read Windows files!


Some Good Aliases

alias md="mkdir"
alias rd="rmdir"
alias newbie="lynx http://www.thebits.co.uk"

Note

To view all the commands from the shell, enter:

alias

...or 'alias | less' or 'alias > allaliases.txt' if the list is big.


By Laurence Hunter laurence@thebits.co.uk

Home Contents Previous Next

Download Latest Manual

www.THEBITS.co.uk - updated daily...