The order of directories in my path is messed up, and I'm trying to correct it. Some of the path seems to be coming in from somewhere other than my user bash config files (I'm using both .bashrc and .bash_profile).
Is there a system wide bash_profile (or other config files?) file which is executed before user specific ones? If so, where is it located by default?
Best Answer
The answer seems to be yes.
Check out the FILE section of Bash Man page
In addition to that, shell paths are also loaded from
/etc/paths
and the files (if any) in/etc/paths.d
by/usr/libexec/path_helper
(which is executed as part of/etc/profile
).Lastly, there's also
/etc/bashrc
, intended for functions and aliases (while/etc/profile
is designated for system wide environment and startup programs).