Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
The default user path in bash is
/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/root/bin:/home/foobar/bin
for user "foobar". I'm trying to find how /usr/kerberos/bin and /usr/local/bin get in there. The aren't in ~/.bash*, nor in /etc/bashrc, nor /etc/profile, nor /usr/include/paths.h. Those are all the places I know to look. There is no /etc/PATH or /etc/path. Is there somewhere else I should check?
The PATH variable is set in a number of places as needed. Look in ~/.profile or ~/.bash_login, /etc/profile and the scripts in /etc/profile.d/. The kerberos part of the path is probably set in /etc/profile.d/krb5-workstation.sh.
Some services may also add to PATH. Try "sudo grep 'export .*PATH' /etc/* 2>/dev/null".
Thanks for the reply. /etc/profile.d/krb5-workstation looks promising. I had never heard of /etc/profile.d before. I would like to RTFM if I could find the FM.
/usr/local/bin is not in ~/.profile or ~/.bash_login or /etc/profile.
The only files in /etc/ which contain "PATH" and "local" are csh.login, lynx.cfg and man.config. Those don't look relevant.
The reason for my question is that some users want to have /usr/bin before /usr/local/bin in their paths. This seems questionable to me, and they could do it for themselves, but now I would really like to figure out how it could be done systemwide.
I found /etc/environment in kubuntu that looks like it has the default path for everyone.
Kurt
Last time I checked, kubuntu isn't RHEL so how's that really going to help the OP with their question?
As for the actual path priority, really doesn't matter, /usr/bin will come before /usr/local/bin in most cases. If a user want's this preference changed, then have them set it in their own .bashrc or .bash_profile
I need to find that default path as well to execute a command via ssh on another host with a shared home dir. My .bash_profile is not being sourced in certain circumstances. check it out and let me know what you think.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.