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 am new to OS X and was following a video and typed

export PATH="$HOME/opt/git/bin:$PATH" 

I believe this messed up my path and I am not able to install MySQL now.

When I tried to install Homebrew I get

-bash: homebrew: command not found.  

I tried restarting the terminal. How can I correct this?

share|improve this question

Where did you get the export line from?

First things first: Look into your home folder (e.g. open a Finder window). Is there really a folder called opt in there? If yes, something's really messed up. If no, your export command was just wrong, since there's no opt under $HOME (which is your user's home folder). /opt is typically at the root level of the file system.

Is there a folder called /opt? Open a Terminal and enter ls /opt. Does this directory exist? If yes, then you're probably using another package manager already and should not install Homebrew.

But even then, if /opt really exists, there shouldn't be /opt/git/bin.

If you really want to install a new version of Git, you can do that with:

  • the git-osx-installer, which will install everything to /usr/local/git/
  • through Homebrew with brew install git, see below, which will install the git command to /usr/local/bin/

To install Homebrew, you have to follow the instructions. There is no homebrew command. You also don't have to change your PATH.

You just have to copy and paste this to your Terminal:

/usr/bin/ruby -e "$(/usr/bin/curl -fsSL"

This will install Homebrew, but make it available under the brew command. So to install MySQL through Homebrew, you'd enter:

brew install mysql
share|improve this answer

You must log in to answer this question.

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