Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'd like to set the $PATH variable for all users but don't find where it is defined.

Having no $PATH export in my .bash_profile I have this

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin

Where is this defined?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

On shell level, $PATH is set in /etc/profile by calling /usr/libexec/path_helper. To add your own paths, you can add files with a path in it to /etc/paths.d/:

pse@Fourecks:~$ ll /etc/paths.d
total 8
-rw-r--r--  1 root  wheel  13 Jul 22 07:02 50-X11
-rw-r--r--  1 root  wheel  12 Aug 13 14:12 TeX
pse@Fourecks:~$ cat /etc/paths.d/TeX 
/usr/texbin

That's the safer way than editing /etc/profile or any other system file which may get overwritten with the next OSX upgrade.

share|improve this answer
    
excellent, thank you –  kaklon Dec 8 '11 at 18:49

Well, if you really wanted to OVERWRITE the path, you could just set the new one in /etc/launchd.conf. There is a similar question here.

share|improve this answer

Your Answer

 
discard

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.