forked from Homebrew/legacy-homebrew
-
Notifications
You must be signed in to change notification settings - Fork 2
The brew command
Zearin edited this page Jun 17, 2011
·
62 revisions
Use man brew to view the manpage.
| Command | Description |
|---|---|
brew --cache |
Print the real path to where Homebrew caches downloads (usually ~/Library/Caches/Homebrew) |
brew --cellar |
Print the real path to your Homebrew Cellar (usually /usr/local/Cellar) |
brew --config |
Print some useful system configuration to the console |
brew --prefix [formula] |
Print where formula is installed |
brew --prefix |
Print the real path to your Homebrew prefix (usually /usr/local) |
brew audit |
Audit all formulae for common code and style issues |
brew cleanup [foo] |
Remove older versions from the Cellar for all (or specific) formulae 4 |
brew create [url] |
Generate formula for downloadable file at url, then open it in $BREW_EDITOR or $EDITOR 1 |
brew create tarball-url --cache |
Generate a formula (including MD5), then download the tarball |
brew create --macports foo |
Open MacPorts’ search page in your browser, so you can see how they do foo |
brew create --fink foo |
Open Fink’s search page in your browser, so you can see how they do foo |
brew doctor |
Check your Homebrew installation for common issues |
brew edit foo |
Open formula in $HOMEBREW_EDITOR or $EDITOR |
brew fetch --force -v --HEAD foo |
Download the source package for foo. For tarballs, also prints MD5 and SHA1 checksums. |
brew home |
Open Homebrew’s homepage in your browser |
brew home foo |
Opens foo ’s homepage in your browser |
brew info |
Summarize all installed packages |
brew info foo |
Print all available info foo (regardless of whether foo is installed) |
brew info --github foo |
Open Github’s History page for foo in your browser |
brew install foo |
Install foo |
brew install --HEAD foo |
Install the HEAD version of foo (if its formula defines HEAD) |
brew install --force --HEAD foo |
Install a newer HEAD version of foo (if its formula defines HEAD) |
brew link foo |
Symlink all installed files for foo into the Homebrew prefix 2 |
brew list [foo] |
List all installed files for foo (or all installed formulae with no arguments ) |
brew outdated |
List formulae that have an updated version available (brew install foo will install the newer version) |
brew prune |
Remove dead symlinks from Homebrew’s prefix 3 |
brew remove foo |
Uninstall foo |
brew search |
List all available formula |
brew search foo |
Search for foo in all available formula |
brew search /foo/ |
Search for the regex /foo/ in all available formula |
brew unlink foo |
Unsymlink foo from Homebrew’s prefix |
brew update |
Update formulae and Homebrew itself |
brew upgrade |
Install newer versions of updated packages |
You can update outdated packages like so:
brew install `brew outdated` (or brew outdated | xargs brew install (or brew upgrade))
1 Homebrew tries to guess the formula name and version. If it fails, you’ll have to make your own template. I suggest copying wget ’s.
2 Symlinking is automatically performed when installing formulae. It’s useful for DIY installation, or swapping out versions of a package you have multiple installs of.
3 This is generally not needed. However, it can be useful if you are doing DIY installations.
4 To delete a specific version, just go to the folder in the Cellar and rm -rf it; alternatively, drag it to the trash in Finder.