Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Previously, when setting up a *NIX environment for the first time, I would put all of my shell customisations into .bashrc, with the following .bash_profile:

if [ -f $HOME/.bashrc ]; then
    . $HOME/.bashrc

However, based on this answer and its associated comments, I've recently moved my PATH redefinition into .bash_profile.

What types of commands do you feel should go into .profile, .bash_profile, .bashrc (and any other dotfiles), and why?

share|improve this question
up vote 10 down vote accepted

They are read or not read in a specific order based on how the shell is invoked. The invocation section of 'man bash' will give the order and when they are read. It depends on if the shell is invoked as a interactive and/or login shell.

This link will tell you the 'why'

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.