Results 1 to 3 of 3
What's the difference between .bash_profile and .bashrc?
I have been reading about Linux and some software I've been using, etc. Some of them advise making a certain change in .bashrc, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-22-2012 #1Just Joined!
- Join Date
- Jul 2010
- Posts
- 20
.bash_profile vs. .bashrc
What's the difference between .bash_profile and .bashrc?
I have been reading about Linux and some software I've been using, etc. Some of them advise making a certain change in .bashrc, others suggest making a change in .bash_profile. I also like to modify my environment a little to make it easier for me to use and to make it consistent across different machines.
The result is that I have several changes scattered through both of those files. Can I consolidate them into one or of them?
I just noticed that all of my changes in _profile are either of the cursor or are "alias" commands. The changes in rc are export commands. (I bet that's a clue if I was more knowledgeable, huh?)
The bottom line is I want to know what's the difference between .bash_profile and .bashrc, and can I consolidate my personalizations in one of them?
Thanks.
- 10-22-2012 #2
At its most fundamental, the difference is that .bash_profile is executed when you log in at the terminal prompt, and .bashrc when you start an X session. For some *nix derivatives this isn't always true (see MacOS X, for instance), but it's the norm in Linux.
Linux user #126863 - see http://linuxcounter.net/
- 10-22-2012 #3Just Joined!
- Join Date
- Jul 2010
- Posts
- 20


Reply With Quote

