I am using Ubuntu Desktop 14.04, and as such, I am using the non-login shell. When I open the GUI terminal, first the non-login shell sessions read the following startup files:
/etc/bash.bashrc
~/.bashrc
The non-login shells inherit the environment from the parent process, which is a login shell, so the session also reads the following startup files:
/etc/profile
~/.bash_profile
However, I cannot find the $PATH
for system-wide paths like /bin
, /sbin
, /usr/bin
, /usr/sbin
, set in any of these files. Where is the $PATH
set for these directories?
$PATH
it's inherited by the parent login shell or if it's reloaded by eachbash
instance? – kos Jun 10 '15 at 04:43$HOME
variable. For instance, adding$HOME/.composer/vendor/bin
to thePATH
in/etc/environment
does not enable binaries in this directory to be executed without a path prefix. Using~/.composer/vendor/bin
does not work either. I'm finding it necessary to add the absolute path, e.g.:/home/vagrant/.composer/vendor/bin
. This seems related (though doesn't explain this behavior): https://askubuntu.com/questions/402353/how-to-add-home-username-bin-to-path – Ben Johnson Jan 26 '18 at 01:40/etc/environment
(and~/.pam/environment
) is read bypam_env
PAM module, not shell or anything else that understands shell/environment variables; same goes for~
expansion. So, you need to use absolute path there. – heemayl Jan 26 '18 at 14:31