Ask Different is a question and answer site for power users of Apple hardware and software. 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

I have added .bash_profile, .bashrc, .profile exeuctables in the /var/root dir. However, unlike the normal users which execute their .bash_profile(s) and change the path. There is no difference in the profiles but the root user one does not work.

I am unclear about how to get this workinkg. Any suggestions? Thanks.

share|improve this question
Generally, one doesn't use the root user in Mac OS X; the "Mac way" is to use sudo. – Daniel Apr 5 '12 at 3:33
up vote 2 down vote accepted

Try adding the path in ~/.profile

share|improve this answer

For system wide changes (including root user) you have to edit /etc/profile or /etc/bashrc.

share|improve this answer

To get to root I find it helpful to use:

sudo su -

This is a login shell, it runs root's dotfiles and sets up whatever environment you want root to have.

However, this will leave $LOGNAME as your logged in user.

To get a full login shell, as if you logged into the console as root:

login -fp root

Also, if you, like me, use root a lot, you can set that login command in your terminal. In iTerm I have a root visor and window where I login as root.


  • using sudo litters my homedir with root owned files. I trip over them,

  • sudo bash or sudo zsh make me root but with my mortal environment. This is not what I want. I want separation.

  • Convenience. There are lots of things that root sees that admin users do not.

Chiggsy works in his homedir.

Root works on the system.

man login
share|improve this answer

If you're using Mac OS X 10.7 or 10.8 you can create a /etc/launchd.conf file and add your variables as is :

setenv PATH /bin:/usr/bin:/Applications/

and reboot

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.