Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

I've noticed that the root account $PATH does not include /usr/local/bin or /usr/local/sbin by default. Are there any potential issues that could arise from adding those directories to the path? If so, what is the best way to make sure your shell finds executables in those directories, without affecting the stability and security of the system?

share|improve this question
up vote 7 down vote accepted

Make sure that the write permissions on the directories and files are reasonable. You don't want "Other" to be able to write there. File owner and group are also very important. You don't want someone adding or changing something that will be executed under root privileges but that may do something either malicious or have unintended consequences.

Adding those directories to the end of the PATH is safer, but doing that doesn't give you the opportunity to have local overrides of standard utilities. There are pluses and minuses to either approach.

If you leave them out of root's PATH, you can still specify the absolute path explicitly.

share|improve this answer
Very comprehensive answer. I neglected to consider the user/group permissions on the /usr/local tree. I rather err on the side of having only executables in the root $PATH that root alone could have put there/changed. – jmlane Mar 3 '11 at 16:04

/usr/local/bin and /usr/local/sbin are generally reserved for user-installed executables. Add them to the end of your path, just in case you're concerned about conflicts. The packages for your distribution should place binaries in /usr/bin and /usr/sbin.

Short version: add the paths to the end of your current path, and you should be fine.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.