iFocus.Life News News - Breaking News & Top Stories - Latest World, US & Local News,Get the latest news, exclusives, sport, celebrities, showbiz, politics, business and lifestyle from The iFocus.Life,

Linux Newbie Administrator Guide

106 27
5.2.7 Mounting command is too long, how can I simplify it with an alias?

An alias is an abbreviation of a more complex or often used command. For creating aliases, I edit, as root, the file /etc/bashrc . This way the aliases are available for all the users on the system. (For creating user-specific aliases, I edit the file .bashrc in the user home directory.) The relevant part of my /etc/bashrc looks like this:

alias cdrom="mount -v /mnt/cdrom"

alias ucdrom="umount -v /mnt/cdrom"

alias dosdrive="mount -v /mnt/dosdrive"

alias udosdrive="umount -v /mnt/dosdrive"

alias zipdrive="mount -v /mnt/zipdrive"

alias uzipdrive="umount -v /mnt/zipdrive"

alias floppy="mount -v /mnt/floppy"

alias ufloppy="umount -v /mnt/floppy"

The option "-v" stands for "verbose", i.e., it tells Linux to talk to me a lot during mounting. For the aliases to take effect, the user has to re-login. Now the user can mount the floppy using this simple command:

floppy

and s/he can unmount it using

ufloppy

* License

* Linux Newbie Administrator Guide Index
Subscribe to our newsletter
Sign up here to get the latest news, updates and special offers delivered directly to your inbox.
You can unsubscribe at any time
You might also like on "Technology"

Leave A Reply

Your email address will not be published.