Homebrew Commands

Homebrew commands cheatsheet.

Install packages and apps, upgrade everything, and keep brew healthy — the commands you need. Tap to copy.

Packages
brew install <pkg>Install a formula
brew uninstall <pkg>Remove a formula
brew search <text>Search for formulae and casks
brew info <pkg>Show details about a package
brew listList installed packages
Apps (casks)
brew install --cask <app>Install a macOS app via cask
brew uninstall --cask <app>Remove a cask app
brew list --caskList installed cask apps
Updating
brew updateUpdate Homebrew and formula definitions
brew upgradeUpgrade all outdated packages
brew upgrade <pkg>Upgrade a single package
brew outdatedShow packages with updates available
brew pin <pkg>Stop a package from being upgraded
Maintenance
brew doctorCheck your setup for common problems
brew cleanupRemove old versions and free up space
brew --prefixPrint the Homebrew install path

The package manager macOS forgot to include

Homebrew is how most developers install command-line tools on a Mac. brew install <tool> fetches and sets up a command-line program, while brew install --cask <app> installs a full graphical macOS app (Chrome, VS Code, Rectangle) and keeps it updatable from the terminal. That second form is underused — managing your GUI apps through Homebrew means one command updates everything instead of chasing download pages.

Keeping things current

Updating is a two-step idea worth understanding. brew update refreshes Homebrew's catalogue of available versions (it doesn't change your installed software), and brew upgrade then actually updates your installed packages to those newer versions. Run them in that order. brew list shows what you've installed, and brew outdated tells you what has updates waiting — handy before a big upgrade.

When something breaks

Homebrew is generally reliable, but when an install misbehaves, brew doctor scans your setup and suggests fixes for common problems like permissions or conflicting files. brew cleanup reclaims disk space by removing old versions Homebrew kept around. And if you're handing your setup to a new machine, brew bundle dump writes a Brewfile listing everything you have, so a single command can recreate it. These pair well with the terminal commands and Git commands on a fresh Mac.

FAQ

What's the difference between brew install and brew install --cask?
Plain brew install adds command-line formulae; brew install --cask installs graphical macOS applications like browsers and editors.
What does brew update vs brew upgrade do?
brew update refreshes Homebrew itself and its list of available packages; brew upgrade actually installs newer versions of the packages you have.

More cheatsheets