Homebrew commands cheatsheet.
Install packages and apps, upgrade everything, and keep brew healthy — the commands you need. Tap to copy.
brew install <pkg>Install a formulabrew uninstall <pkg>Remove a formulabrew search <text>Search for formulae and casksbrew info <pkg>Show details about a packagebrew listList installed packagesbrew install --cask <app>Install a macOS app via caskbrew uninstall --cask <app>Remove a cask appbrew list --caskList installed cask appsbrew updateUpdate Homebrew and formula definitionsbrew upgradeUpgrade all outdated packagesbrew upgrade <pkg>Upgrade a single packagebrew outdatedShow packages with updates availablebrew pin <pkg>Stop a package from being upgradedbrew doctorCheck your setup for common problemsbrew cleanupRemove old versions and free up spacebrew --prefixPrint the Homebrew install pathThe 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.