Homebrew is like an App Store for your terminal. It makes installing, updating, and removing software easy. Whether you need command-line tools or Mac apps, Homebrew handles it all without dragging .dmg files around.
Homebrew installs two types of software:
- Formulas: Command-line tools like
git,python, ortree. These tools run in the terminal.- Install with:
brew install <formula_name>
- Install with:
- Casks: Mac apps like Google Chrome, VS Code, or Spotify. These apps appear in your
/Applicationsfolder.- Install with:
brew install --cask <cask_name>
- Install with:
Here are the most common commands you'll use:
- Update Homebrew's Catalog: Refresh the list of available software.
brew update
- Upgrade Installed Software: Update all tools and apps installed via Homebrew.
brew upgrade
- Do Both Together:
brew update && brew upgrade
- Install a Command-Line Tool (Formula):
brew install <formula_name> # Examples: brew install tree # Shows directory structures brew install htop # Advanced activity monitor brew install jq # Processes JSON data
- Install a Mac App (Cask):
brew install --cask <cask_name> # Examples: brew install --cask firefox # Installs Firefox browser brew install --cask slack # Installs Slack messaging app brew install --cask rectangle # Installs Rectangle window manager
- See What's Installed:
brew list # Lists installed command-line tools brew list --cask # Lists installed Mac apps
- Get Info About a Package:
brew info <formula_name> brew info --cask <cask_name> # Examples: brew info git brew info --cask visual-studio-code
- Uninstall Software:
brew uninstall <formula_name> brew uninstall --cask <cask_name> # Examples: brew uninstall tree brew uninstall --cask firefox
- Remove Old Files: Free up disk space by deleting old versions of software.
brew cleanup
- Example Output:
Removing: /opt/homebrew/Cellar/node/18.15.0... (X files, Y MB) ==> Pruning caches Removed X files and Y MB
- Example Output:
- Check for Problems: If something isn't working, run this command. It often tells you how to fix issues.
brew doctor
- Example Output:
Your system is ready to brew.
- Example Output:
Some tools (like databases) can run in the background.
- List Services:
brew services list
- Start a Service:
brew services start <service_name> # Example: brew services start redis
- Stop a Service:
brew services stop <service_name>
- Restart a Service:
brew services restart <service_name>
Not sure if Homebrew has what you need? Search for it:
brew search <keyword>
# Examples:
brew search mysql # Search for MySQL database
brew search image editor # Search for image editing tools/apps
brew search node # Search for Node.jsKeep your tools fresh by running:
brew update && brew upgradeHomebrew makes managing software on your Mac simple and efficient. Dive in and explore!