Linux: Hidden files
Before you start using Linux you should be aware of specific files that
exist in your home directory. To view these files type
Editing .bashrc file
Introduction to Aliases:
In the .bashrc, you can add something called an 'alias'.
Everybody knows what 'alias' means- 'an assumed name'.
An 'alias' in this file are some lines that you write so
that your bash shell assumes that one command is really a
variation of it. As you already know, you can modify a
command with a slash '-' and a letter. To see where the
.bashrc file was, you could have typed 'ls -a' and that
would have shown you every file in the directory, including
those that start with '.' If you find yourself using these '-letter'
combinations a lot, you can modify your .bashrc file so that
even though you type the simple command, like 'ls', you actually get 'ls -a'.
Some of these aliases may be very important to keep you
from deleting that program that you just wrote into non-existence by accident.
It would be advisable if students had some if not all of the following
aliases in their .bashrc file.They are:
'cp' is the command to copy a file to another place or to make a copy of a file under a different name. In order not to copy a file to a place where there's already a file by the same name, you could type cp -v -i, (-v for verbose, -i for interactive) and it would ask you if you really want to do it in case there's another file by the same name. Then the -v would show you where it went. This is probably a good idea all the time, so you could create an alias for it in your '.bashrc' file. 'rm' is the remove/delete command (i.e gone forever) You obviously have to be very careful with this one, because in the bash shell there is really no 'trash' bucket to pick it out of if you delete it. That's why you should add the -i (interactive) command to your alias, so that it will ask you if you really want to delete that program that you just wrote. 'mv' is for moving files to a different place or renaming a file. You should/will have an alias for it for the same reasons as the 'cp' command.
Changing the default prompt
To change the default primary prompt, you need to set the shell variable
The .bash_logout file:
The .bash_logout file is read whenever you log out. If there are things you want to run whenever you log out, add lines here to start them---just as in any shell script.Comments can be added by preceding the line of text with a '#' sign.
The .bash_login file:
The .bash_login file is read whenever you log in assuming that bash is your shell. As you can see, everything here is commented out (with #). If there are things you want to run whenever you log in, add lines here to start them---just as in any shell script.
The .Xdefaults file:
The .Xdefaults file is a place to put your preferences about fonts, colours, and other attributes of applications running under the X window system. In the .Xdefaults file, you can for example specify the background and foreground colours of the xterm for you session. As with any of the hidden files on your home directory be sure to modify them only if you understand what you are doing.
Department of computer science and information systems
University of limerick, limerick, Eire
Department of Computer Science and Information Systems, University of Limerick, Limerick, Eire