Homebrew Essentials
Homebrew is the de-facto package manager for macOS. Everything below assumes it is already installed; if not, bootstrap it with a single line.Install Homebrew
/opt/homebrew/ — remember to add it to your PATH (see PATH Management below).Install packages
Keep everything up to date
Diagnose problems
Oh My Zsh and Shell Customisation
macOS has shipped Zsh as the default shell since Catalina. Oh My Zsh turbo-charges it with plugin management, themes, and hundreds of community shortcuts.Install Oh My Zsh
Pick a theme
~/.zshrc and set your preferred theme. A reliable, information-dense
choice for DevOps work:Enable useful plugins
plugins=(...) block) in ~/.zshrc, then reload:z plugin tracks your most-visited directories and lets you jump to them
with z <partial-name> instead of typing full paths. It pays for itself
within the first hour.macOS-Specific Terminal Commands
These commands either don’t exist on Linux or behave differently — they’re worth knowing because they integrate tightly with macOS internals.open — launch anything from the terminal
open — launch anything from the terminal
open is the terminal equivalent of double-clicking in Finder.pbcopy / pbpaste — clipboard integration
pbcopy / pbpaste — clipboard integration
say — text-to-speech notifications
say — text-to-speech notifications
caffeinate — prevent sleep during long jobs
caffeinate — prevent sleep during long jobs
networksetup — manage network from the CLI
networksetup — manage network from the CLI
diskutil — disk and volume management
diskutil — disk and volume management
defaults — read and write macOS preferences
defaults — read and write macOS preferences
defaults exposes as a CLI.SSH Key Management on macOS
macOS Keychain can store SSH key passphrases so you authenticate once per boot rather than per session.Generate a new key
Add the key to the agent with Keychain
--apple-use-keychain flag (macOS-only) stores the passphrase in
Keychain so you’re only prompted once per machine restart.Persist across reboots via ~/.ssh/config
Copy the public key to a remote host
List keys currently loaded in the agent
iTerm2 Tips
iTerm2 is the standard terminal emulator for macOS power users. A few features that pay dividends immediately:PATH Management
On Apple Silicon, Homebrew lives at/opt/homebrew/bin, not /usr/local/bin. Managing PATH cleanly avoids subtle version conflicts between system tools and Homebrew-installed ones.
~/.zprofile for environment variables (runs at login) and ~/.zshrc
for interactive settings like aliases and plugins (runs per shell session).
Avoid duplicating PATH exports across both files.DevOps Aliases
Drop these into~/.zshrc (or a sourced ~/.zsh_aliases file). Reload with source ~/.zshrc.