Re: Difference between .bashrc and .bash_profile?

From: Alex Zarutin (alexzar_at_gmail.com)
Date: 01/28/05


Date: 28 Jan 2005 14:23:22 -0800


<.bash_profile> contains a list of commands to be executed when you log
in and
<bashrc> contains a list of commands to be executed every time you open
a new shell.
There is a slight difference between them: <.bash_profile> is read once
at the beginning of a session, whereas <.bashrc> is read every time you
open a new terminal (e.g. a new xterm window). In a traditional setup
you would define variables like PATH in <.bash_profile>, and things
like aliases and functions in <.bashrc>. But since <.bash_profile>
usually is pre-configured to read the content of <.bashrc> anyway, you
might as well save some effort and put all your configuration into
<.bashrc>.



Relevant Pages