6

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?

2 Answers 2

11

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'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .