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.

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 has been asked before and already has an answer. If those answers do not fully address your question, please ask a new 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

2 Answers 2

On OS X there are several locations where you can define $PATH. One is ~/.bash_profile (Terminal.app 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'

From http://stackoverflow.com/questions/5509587/unix-making-change-to-profile-file

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.