Saturday, June 18, 2016

.bash_profile or .bashrc

Trying to setup oracle database on Linux after a long time, I was trying to put ORACLE_HOME variables (or source it from another file) etc in .bash_profile but realized that it should be .bashrc. I stumbled upon a great article on the differences of .bash_profile vs .bashrc, here is the link from Josh Staiger's blog.

http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html
"When you login (type username and password) via console, either sitting at the machine, or remotely via ssh: .bash_profile is executed to configure your shell before the initial command prompt.
But, if you’ve already logged into your machine and open a new terminal window (xterm) inside Gnome or KDE, then .bashrc is executed before the window command prompt. .bashrc is also run when you start a new bash instance by typing /bin/bash in a terminal."