Thursday, 28th August 2008
Bash (your shell) reads several config files on startup.
It first reads and executes commands from the file /etc/profile, if that file exists. The idea behind this file is to easily facilitate system wide configuration changes by administrators.
After reading that file, it looks in the user's home directory (where you are when you log on) for the hidden files .bash_profile (which then executes .bashrc), .bash_login, and .profile, in that order, and reads and executes commands from the first one that exists and is readable.
Files preceded by a period '.' are hidden to the usual 'ls'. To show all these hidden files you will have to run:
$ ls -a
For more information on this see Listing files.
So what does each of these files do? Well the general idea is:
To edit any of the options described in this document, edit that file (e.g. nano .bashrc). Next we'll look at command aliases.