The .profile dates back to the original Bourne shell known as sh. Since the GNU shell bash is (depending on its options) a superset of the Bourne shell, both shells can use the same startup file. That is, provided that only sh commands are put in .profile For example, alias is a valid built-in command of bash but unknown to sh. Therefore, if you had only a .profile in your home directory and ...
What is the difference between .profile and .bash_profile and why don't ...
The original sh sourced .profile on startup. bash will try to source .bash_profile first, but if that doesn't exist, it will source .profile. Note that if bash is started as sh (e.g. /bin/sh is a link to /bin/bash) or is started with the --posix flag, it tries to emulate sh, and only reads .profile. Footnotes: Actually, the first one of .bash_profile, .bash_login, .profile See also: Bash ...
Bash behaves differently depending on if it believes that it is a login shell, i.e. the first shell run when you log onto a system. It only reads .bash_profile if it is a login shell. If you put the PATH -changing code into .bashrc instead, it will be run for all interactive bash shells, not just login shells.
.bash_profile not sourced when running su - Unix & Linux Stack Exchange
It says that the /etc/profile file sets the environment variables at startup of the Bash shell. The /etc/profile.d directory contains other scripts that contain application-specific startup files, which are also executed at startup time by the shell. Why are these files not a part of /etc/profile if they are also critical to Bash startup ?