Homebrew is a package manager for Mac OS X.

# To search formula:
brew search text

# To install formula:
brew install formula

# To list all installed formulae:
brew list

# To get latest version of installed formula (passing no formula updates all installed formulae):
brew upgrade formula

# To update brew:
brew update

# To switch version of formula:
brew switch formula version

# To display information about formula, which contains formula version, installed path, dependencies, etc.:
brew info formula

# To check your system for potential problems:
brew doctor

# Incorrect permission issue
#
#   - https://github.com/mxcl/homebrew/issues/13276
#   - https://github.com/mxcl/homebrew/wiki/Troubleshooting
#
# What doctor said:
#
# Error: Some directories in /usr/local/share/locale aren't writable.
#
# This can happen if you "sudo make install" software that isn't managed
# by Homebrew. If a brew tries to add locale information to one of these
# directories, then the install will fail during the link step.
#
# You installing something via sudo or a pkg, and it took ownership of a
# bunch of share folders. You'll want to chown them back to your user.
#
# The following command should set the correct ownership and group for all files and directories
# below and including `/usr/local/share`
sudo chown -R $(whoami) /usr/local