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

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .