# Bash

It is often convenient to load environment variables and other configurations every time you launch a bash shell. The question arises which startup files need to be configured in order achieve this. In fact, there is quite a large collection of startup files that may or may not be loaded by the shell, depending on a number of parameters. For novice users, this soup of configuration files may come across as quite a mess, and perhaps it is. Lets first specify the most common configuration files, and then discuss each of its functions.

~/.bashrc
~/.bash_profile
It could very well be that you want to add directories to your $PATH, and specify aliases that apply to both to login and non-login shells. If this is the case, there is an easy hack. You could instruct ~/.bash_profile to execute the commands specified in ~/.bashrc by adding the following lines to your ~/.bash_profile file. if [ -f ~/.bashrc ]; then source ~/.bashrc fi Now, you only have to specify the$PATH variable; your aliases and all other common shell configurations in the ~/.bashrc startup file.