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

Possible Duplicate:
What are PATH and other environment variables, and how can I set or use them?

I'm currently trying out Homebrew and it has told me to list it's folder before the default installation path in the .profile.

After some googling it appears that I have to make this file myself as it is not generated. But I have no idea what a file like this looks like and I struggle finding any examples through the normal channels i.e Google.

Could you guys be of assistance?

share|improve this question

marked as duplicate by slhck Nov 19 '12 at 11:14

This question was marked as an exact duplicate of an existing question.

Simply add export PATH=/usr/local/bin:$PATH to your ~/.bash_profile or ~/.profile (if you want it for other shells as well). – slhck Nov 19 '12 at 11:15
You edit /etc/paths to have "/usr/local/bin" on top to have Homebrew's packages be prioritised. – Eivind B Apr 14 '13 at 12:04

On OS X there are several locations where you can define $PATH. One is ~/.bash_profile ( starts the shell as a login shell on OS X, so it has to be .bash_profile instead of .bashrc). This affects only bash. The other is ~/.MacOSX/environment.plist which can be edited either with the plist editor (if you have XCode installed) or the defaults command. This affects all GUI applications.

However, according to this article environment.plist doesn't work in Mountain Lion anymore and you have to add a line setenv PATH /bin:/usr/bin:... to /etc/launchd.conf instead.

share|improve this answer

Found this:

export PATH=$PATH:/opt/local/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/local/lib

alias sl='ls'
alias pwd='echo -n `pwd` | pbcopy'


share|improve this answer
This doesn't work since Homebrew isn't installed in /opt. Furthermore, only the first line would be necessary. The three others are irrelevant to the question and setting the LD_LIBRARY_PATH is not encouraged. Also, the OP wanted to have Homebrew folders before other PATH directories, not after. – slhck Nov 19 '12 at 11:13

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