Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
fi

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

2 Answers 2

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

 
discard

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.