C.W.K.
Stream
Lesson 08 of 10 · published

Homebrew Essentials

~10 min · homebrew, package, macos

Level 0Window Tourist
0 XP0/95 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

The de-facto macOS package manager

Homebrew (brew) installs CLI tools, GUI apps, and fonts on macOS (and Linux). It is the path of least resistance for almost every command-line tool you'll meet — including the modern-tools track's ripgrep, fd, fzf, bat, eza, etc.

Install once

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then add to ~/.zprofile:

eval "$(/opt/homebrew/bin/brew shellenv)"

Daily commands

  • brew install jq — install a CLI tool (formula).
  • brew install --cask iterm2 — install a GUI app (cask).
  • brew uninstall jq
  • brew update — refresh formula list.
  • brew upgrade — upgrade everything.
  • brew list — what's installed.
  • brew leaves — top-level installs (no dependent).
  • brew info jq — version, deps, caveats.
  • brew search ripgrep — find a formula.
  • brew doctor — diagnose problems.

Brewfile — reproducible installs

brew bundle dump --file=Brewfile writes a list of every formula and cask installed. brew bundle install --file=Brewfile restores the same set on a new Mac. This is your one-liner Mac-setup tool.

Services

brew services list shows every long-running service brew manages (postgres, redis, etc.). brew services start postgresql wires up a launchd plist. Stop with brew services stop.

Code

First-day Mac setup pattern·bash
# Save your current set
brew bundle dump --file=~/Brewfile
# Restore on a new Mac
brew bundle install --file=~/Brewfile
# Inspect a tool before installing
brew info ripgrep

External links

Exercise

Run brew leaves > ~/my-brew-leaves.txt. Read it. Then brew bundle dump --file=~/Brewfile. Open the Brewfile and see brew, cask, tap, and mas entries. This file is now your Mac inventory.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.