Skip to main content

1.13 Initialisation files

Upon startup, many Linux programs are configured to look for initialisation files in a user's home directory. These files contain commands that the program will execute before it does anything else. The files are unusual in that they always begin with a . (a dot - hence why they are sometimes referred to as dot files). These initialisation files sometimes also set up environment variables.

A special initialisation file is your login initialisation file. If you use bash, then this file will be called .bash_profile - when you are first given your account, you will have an 'off the peg' version of this file provided. When your login shell first starts up, it will look for and execute commands in your .bash_profile. As a user, you can make alterations to this file, in particular setting up environment variables for programs that you often use. You should also set your $PATH environment variable in this file.

Another special initialisation file is your .bashrc (rc stands for 'run command') file. This file contains commands such as the setting of aliases (more about later).