Saturday, October 10, 2009

Order of execution for /etc/profile .bash_profile .bash_login .profile /etc/bash.bashrc .bashrc

If interactive login-shell or non-interactive login shell with --Login option is started, it will start reading & executing in the order /etc/profile, .bash_profile, .bash_login and finally .profile

If interactive shell, that is a non-login shell is started, it will start reading & executing in the order /etc/bash.bashrc, .bashrc

Difference between .profile and .bashrc

.profile will be read, whenever login-shell is started

.bashrc will be read, whenever new interactive shell(not a login shell) is started