How to tell if homebrew is installed on Mac OS X

Kmb40 picture Kmb40 · Feb 5, 2014 · Viewed 146k times · Source

I am doing some Rails programming and I consistently see Homebrew referenced in solutions around the web but have never used it.

I also notice Homebrew in the terminal version 2.9 as an option next to "Shell -> New" from the terminal drop down but when I select homebrew and issue commands, they fail.

Usually with the "command not found" error.

Strangely enough I have been unable to locate a simple command to determine whether brew is installed or not.

How do I check to see if Homebrew is already installed on my Mac?

Answer

bmargulies picture bmargulies · Feb 5, 2014

brew help. If brew is there, you get output. If not, you get 'command not found'. If you need to check in a script, you can work out how to redirect output and check $?.