Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to set the PATH on my Mac 10.7.

So in /etc/launchd.conf I wrote:

setenv PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin/:/usr/local/sbin/

and I restarted Mac.

However when I write in terminal

echo $PATH

I get:

/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/bin/:/usr/local/sbin/

How can I change the PATH param?

share|improve this question

2 Answers 2

up vote 2 down vote accepted
export PATH=$PATH:/path/to/my/stuff
share|improve this answer

Reset launchd.conf to its default settings. It's better to keep /etc files alone if you don't know what you are doing. :-)

Also, it's not advisable to completely overwrite your PATH; you can add directories to your pre-existing PATH in a very simple way.

You can change OS X's PATH parameter in the shell environment simply by editing ~/.profile or ~/.bash_profile. For example, in my .profile I have added some directories to my pre-existing PATH:

PATH="${PATH}:~/bin:/Users/Shared/bin:/usr/local/mysql/bin"

You have some subdirectories of /opt in your PATH. I guess that they have been added by MacPorts. If you want to remove them, simply comment out (#) or remove the corresponding lines in your .profile. To edit those hidden files, you can use CLI editors like vim or nano (included into OS X).

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.