Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This 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.


  Search this Thread
Old 09-11-2007, 07:40 PM   #1
Registered: Jan 2006
Distribution: RHEL 4, Scientific Linux, Centos, Ubuntu
Posts: 58

Rep: Reputation: 15
Question How does the default PATH get set on RHEL?


The default user path in bash is
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?
Old 09-11-2007, 07:49 PM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680Reputation: 680
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/

Some services may also add to PATH. Try "sudo grep 'export .*PATH' /etc/* 2>/dev/null".

Last edited by jschiwal; 09-11-2007 at 07:52 PM.
Old 09-11-2007, 08:20 PM   #3
Registered: Jan 2006
Distribution: RHEL 4, Scientific Linux, Centos, Ubuntu
Posts: 58

Original Poster
Rep: Reputation: 15
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.
Old 09-11-2007, 08:27 PM   #4
Registered: Dec 2005
Location: India
Distribution: Ubuntu Feisty Fawn
Posts: 107

Rep: Reputation: 15
Check the directory /etc/skel/. IIRC that's the directory which has the startup scripts which get copied when a new account is created.
Old 10-27-2008, 08:54 AM   #5
Registered: Aug 2005
Distribution: Suse
Posts: 54

Rep: Reputation: 15
I found /etc/environment in kubuntu that looks like it has the default path for everyone.
Old 10-28-2008, 12:03 AM   #6
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 260Reputation: 260Reputation: 260
Originally Posted by petersk View Post
I found /etc/environment in kubuntu that looks like it has the default path for everyone.
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
Old 02-18-2009, 03:29 PM   #7
LQ Newbie
Registered: Feb 2009
Location: Minneapolis
Distribution: RHEL 4 & 5
Posts: 12

Rep: Reputation: 0
I'm having a similar problem. See thread

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.
Old 12-09-2009, 10:07 AM   #8
LQ Newbie
Registered: Dec 2009
Posts: 1

Rep: Reputation: 1
In RHEL or CentOS add a script to /etc/profile.d to setup the path to your application.

eg. To add a path to ree (Ruby Enterprise Edition on my machine):

In /etc/profile.d/
if ! echo ${PATH} | /bin/grep -q /opt/ree/bin ; then
Follow the pattern in the other scripts in /etc/profile.d to see how this was done.
1 members found this post helpful.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL 5 w/ Gnome - How to set 32 bit Firefox as default browser? rkmason Red Hat 2 07-01-2007 11:42 AM
RHEL WS4: change installation path ghee22 Red Hat 2 01-10-2006 10:09 AM
Set the path systemwide/Set the path for a user with Slackware jayhel Slackware 1 06-12-2005 01:24 AM
Is there a way to change source install path on RHEL? guest Linux - Newbie 1 04-11-2005 06:01 PM
How to set PATH How do I set PATH environment variable? Tranquil Linux - Newbie 3 11-02-2003 03:52 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:18 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration