Guides

macOS

Commands and config for macOS developer workflows.

1 min read

Homebrew

TaskCommand
Update package indexbrew update
Upgrade all installed packagesbrew upgrade
Upgrade a specific packagebrew upgrade <package>
Remove old versions of packagesbrew cleanup
Check for problemsbrew doctor
List installed packagesbrew list
List outdated packagesbrew outdated
List top-level installs (no dependents)brew leaves
Show what depends on a packagebrew uses --installed <pkg>
Uninstall a packagebrew uninstall <package>

Brewfile

Use a Brewfile to declaratively manage your installed packages, useful for bootstrapping a new machine.

# Dump currently installed packages to a Brewfile
brew bundle dump --file=~/Brewfile

# Install everything in a Brewfile
brew bundle install --file=~/Brewfile

Example Brewfile:

brew "git"
brew "fnm"
brew "direnv"
cask "cursor"
cask "rectangle"

Networking

Ports & Processes

Find what is listening on a port:

lsof -i :3000

Kill whatever is on a port:

kill -9 $(lsof -ti :3000)