Commands

Manipulate Formulae & Casks

brew update

Fetch the newest version of Homebrew and all formulae from GitHub using git(1) and perform any necessary migrations.

brew upgrade

Upgrade outdated casks and outdated&unpinned formulae using the same options they were originally installed with, plus any appended brew formula options.

If cask or formula are specified, upgrade only the given cask or formula kegs (unless they are pinned; see pin, unpin).

brew outdated

List installed casks and formulae that have an updated version available. By default, version information is displayed in interactive shells, and suppressed otherwise.

brew list/ls

List all installed formulae and casks.

brew search/-S <formula>: Use regular expression

If <formula> is flanked by slashes, it is interpreted as a regular expression. e.g.:

brew install

Install a formula or cask. Additional options specific to a formula may be appended to the command.

brew uninstall/remove/rm

Uninstall a formula or cask.

Symlink all of formula's installed files into Homebrew's prefix. This is done automatically when you install formulae but can be useful for DIY installations.

Remove symlinks for formula from Homebrew's prefix. This can be useful for temporarily disabling a formula:

brew unlink formula && <some commands> && brew link formula

e.g.

brew info

Display brief statistics for your Homebrew installation.

If a formula or cask is provided, show summary of information about it.

brew deps

Show dependencies for formula. Additional options specific to formula may be appended to the command. When given multiple formula arguments, show the intersection of dependencies for each formula.

Query Env Info

brew home

Open a formula or cask's homepage in a browser, or open Homebrew's own homepage if no argument is provided.

brew --prefix

Display Homebrew's install path. Default:

  • macOS Intel: /usr/local

  • macOS ARM: /opt/homebrew

If formula is provided, display the location where formula is or would be installed.

brew --repository

Display where Homebrew's git repository is located.

If user/repo are provided, display where tap user/repo's directory is located.

brew --cache

Display Homebrew's download cache. See also HOMEBREW_CACHE.

If formula is provided, display the file or directory used to cache formula.

brew --cellar

Display Homebrew's Cellar path. Default: $(brew --prefix)/Cellar, or if that directory doesn't exist, $(brew --repository)/Cellar.

If formula is provided, display the location in the Cellar where formula would be installed, without any sort of versioned directory as the last path.

brew --caskroom

Display Homebrew's Caskroom path.

If cask is provided, display the location in the Caskroom where cask would be installed, without any sort of versioned directory as the last path.

brew --env

Summarize Homebrew's build environment as a plain list.

brew shellenv

Print export statements. When run in a shell, this installation of Homebrew will be added to your PATH, MANPATH, and INFOPATH.

The variables HOMEBREW_PREFIX, HOMEBREW_CELLAR and HOMEBREW_REPOSITORY are also exported to avoid querying them multiple times. To help guarantee idempotence, this command produces no output when Homebrew's bin and sbin directories are first and second respectively in your PATH. Consider adding evaluation of this command's output to your dotfiles (e.g. ~/.profile, ~/.bash_profile, or ~/.zprofile) with: eval "$(brew shellenv)"

brew config

Show Homebrew and system configuration info useful for debugging. If you file a bug report, you will be required to provide this information.

brew commands

Display the path to the file being used when invoking brew <cmd>.

brew doctor

Check your system for potential problems. Will exit with a non-zero status if any potential problems are found. Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue.

If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this.

brew help <cmd>

Or use brew <cmd> -h

Show help info for a command. e.g.:

GLOBAL OPTIONS

These options are applicable across multiple subcommands.

  • -d, --debug: Display any debugging information.

  • -q, --quiet: Make some output more quiet.

  • -v, --verbose: Make some output more verbose.

  • -h, --help: Show this message.

Last updated