Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

rhel 5 root has /bin/bash for shell. I removed pathmunge /usr/local/sbin from /etc/profile. There is no /usr/local/sbin in /etc/profile.d/* /etc/bashrc /root/.bashrc /root/.bash_profile /root/.profile

After reboot, /usr/loca/bin still shows up in the root path.

How does rhel 5 set default PATH for root? Which config file has /usr/local/sbin?

share|improve this question

migrated from Jun 16 '11 at 20:43

This question came from our site for professional and enthusiast programmers.

/etc/paths? /etc/paths.d/*? – Daniel Beck Jun 16 '11 at 20:45
Any reason not to go ahead and modify root's .bashrc? Also, please reformat your question - it is a little difficult to read in its current form. – new123456 Jun 17 '11 at 2:41

bash has a default value for PATH that is built into the binary. On RHEL it is set to /usr/local/bin:/bin:/usr/bin. Since /etc/profile and the scripts in /etc/profile.d never explicitly set PATH (they instead modify it with constructs like PATH=$PATH:/somedir), you're left with that built-in PATH as a starting point.

If you'd like get rid of this, you have to explicitly set PATH. I suggest doing it by putting


At the top of /etc/profile.

share|improve this answer

You must log in to answer this question.