Customizing your shell and the defaults
In your homedirectory you will find files called
- .bashrc
- .bash_profile
- .bash_logout
Typing ls fails to see them because they are known as "dot files" or "hidden files". To see them use the -a switch with ls ie ls -a
These files are important and should never be deleted no matter how desperate you are for extra disk space. In the .bashrc and .bash_profile are commands that are executed when you log in. Any content you add to these files must be added after the line
# Add personal customisation commands after this line ------------------
in order for the damtp specific setup to be added.
Default Shell Scripts
Should you accidenty muddle these files up or edit them in such a way that some common commands like matlab or pine no longer work for you then you can copy the default ones back into your homedirectory. These are at /opt/damtp/defaults/ so that /opt/damtp/defaults/.bashrc will replace your .bashrc file etc.
.bashrc and .bash_profile are run when you login while .bash_logout is run when you logout. You can add commands into these files to run when you login or logout.
Example Edits / Customisations
You can also add commands to change the way things are done for example
- alias
- renaming a command to another, or giving a sequence of commands a name for example
alias rename=mv
if you find it difficult to remember that the unix command mv is used to rename files.alias mroe=more
to correct frequently mistyped wordsalias programb=/home/user-maint/abc123/bin/programb.pl
An alias to run a program installed in the shared software area.alias nipah='cd /home/scratch/nipah/public/ab123'
An alias to change directory to where your scratch space is. (replacing user ab123 with your login and nipah with whatever computer you are using for scratch space). Then from any computer you can type the name of the alias - in this case nipah and you will be put into your scratch directory there. - export
- Adding a particular setting, for example if I want the system to know about the programs I have installed in scratch space on say pay, in a directory called my-programs, I might add that directory to my PATH, so when I type in the name of the program the system can run it without needing to be told everytime where it is.
export PATH=$PATH:/home/scratch/pay/public/my-programs/
Then if the system cannot find a program in any of the standard directories on my path it will check the above scratch directory. If some of the programs in the scratch directory have the same names as system provided ones and I my ones to take precedence, then I need to list the scatch directory first egexport PATH=/home/scratch/pay/public/my-programs:$PATH
To have the system remember this each time you log in, add the line to your .bashrc file, underneath the lines# Add personal customisation commands after this line ------------------
The commands before the above line include one which sets up your path if you add your command before that, it will get overwritten by the command setting up the default path.
Useful Links
Please email any suggestions, corrections, broken links, or errors to iteb [iteb