FRJ's Linux BASH1

Return to Linux Page

Do you remember the DOS autoexec.bat file?  Well there is something that is kind of like it in Linux.  Lets suppose that when you login to Linux you want to do several things.  First we want to mount the Zip drive, and second we want to launch the KDE desktop.  Remember that I didn't like "clear" to erase the screen?  We will fix that too.  We do this by editing "root/.bashrc"

This assumes that you have made a mount point called "/zip".  You do this by typing "mkdir /zip" to the command line prompt.  Now launch the KDE desktop with a "startx" to the command line prompt.

We select the files icon from the tool bar.  That will show us two directories "Desktop" and "root".  In the location line we have "file:/root/" and here we add ".bashrc" and press enter.  This opens the ".bachrc" file for editing.

UNIX folks would say use "vi" to edit this file and you could do just that.  Purists don't want you messing with "." files either.  But hay its your system!!

Add the following at the end of the ".bashrc" file

# Some comment to document your changes
mount -t vfat /dev/sda4 /zip
alias clr="clear"
startx
Exit and save the file.

Log out of the KDE desktop. And then log out of Linux. Log right back in and guess what...your desktop launches automatically.

Now logout of the desktop and you will return to a screen full of stuff. Type "clr" and the screen is erased.

If you make these changes to "/etc/bashrc" all users are effected