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?
$PATHit's inherited by the parent login shell or if it's reloaded by eachbashinstance? – kos Jun 10 '15 at 04:43$HOMEvariable. For instance, adding$HOME/.composer/vendor/binto thePATHin/etc/environmentdoes not enable binaries in this directory to be executed without a path prefix. Using~/.composer/vendor/bindoes 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_envPAM 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