1. Essential Commands Every Mac User Should Know
Before you install a single package or write a line of configuration, there is a core set of commands that forms the vocabulary of the shell. These are the verbs you'll type dozens of times a day, and fluency with them is the difference between the Terminal feeling like a chore and feeling like a superpower. Each command below is small on its own, but they compose into fast workflows when you chain them with pipes, redirection, and command substitution.
Think of this section as a working dictionary. Open your Terminal, try each command on a safe directory such as ~/Desktop/sandbox, and watch the output. Reading a command's description tells you what it does; typing it until your fingers remember the flags is what makes it stick. The macOS shell is zsh by default on recent versions and bash on older systems — these commands work identically in both.
Navigation and Inspection
Every session begins with knowing where you are and what's around you. The following four commands handle 90% of day-to-day navigation.
pwd (print working directory) tells you exactly where in the filesystem your shell is sitting. Pair it with ls to see what's in that directory. The -la flags give you a long listing including hidden files, permissions, owners, and sizes, which is the view you'll want most of the time.
Move around with cd. Typing just cd with no arguments takes you home. cd - jumps back to the previous directory, which is extremely useful when toggling between two project folders.
Create directories, including nested ones, in a single command with mkdir -p. The -p flag makes any missing parent directories without complaining.
Moving, Copying, and Deleting
The classic trio cp, mv, and rm handle every file operation you can do in Finder, but with the ability to use wildcards and operate on hundreds of files at once. cp -R copies directories recursively, mv renames or relocates, and rm deletes.
rm -rf is irreversible. There is no Trash, no undo, no "are you sure?" dialog. A misplaced space turns rm -rf ~/Downloads/temp into rm -rf ~ /Downloads/temp, which deletes your entire home folder. Always double-check the path, consider ls on it first, and never run rm -rf on a variable path without verifying the variable is non-empty.
Reading, Searching, and Finding
cat dumps a whole file to the screen — perfect for small files. For larger ones, less gives you a scrollable pager (press q to quit). grep is the search workhorse: it filters lines matching a pattern, and with -r it recursively searches entire directory trees. find locates files by name, size, type, and age.
The find example above lists every .dmg installer in your Downloads folder older than 30 days — the first step towards reclaiming gigabytes of disk space.
Monitoring and Disk Usage
top shows live CPU and memory usage. On modern Macs, htop (installed via Homebrew) is much nicer. df -h reports filesystem free space in human-readable units, and du -sh * summarizes the size of every item in the current directory.
macOS-Specific Superpowers
macOS ships several commands that don't exist on Linux and that bridge the shell with the rest of the desktop. open opens any file or folder with its default app — including the current directory in Finder with open ., or a URL in your browser.
The clipboard pair pbcopy and pbpaste is pure gold. Pipe anything into pbcopy and it lands on your clipboard, ready to paste into any app. Pipe pbpaste into any command and the current clipboard contents stream in as input.
man ls, man grep, or man find to read the full documentation, flags, and examples. Press / to search inside a man page and q to quit. Reading one new man page a week will quietly turn you into a shell power user over a year.
2. Customizing the Terminal and Your Shell
A default Terminal is like a brand-new keyboard with no key caps: functional, but joyless. A tuned shell is the opposite — a tool that fits your hands, shows you useful information at a glance, autocompletes aggressively, and feels fast. On modern macOS, your login shell is zsh, and almost all customization lives in a single file: ~/.zshrc. Edit it, open a new Terminal tab, and your changes are live.
The customization stack has three layers: the shell itself (zsh), a framework like oh-my-zsh that bundles plugins and themes, and the terminal emulator (Terminal.app, iTerm2, Warp, Ghostty, or Wezterm) that renders characters. Changes to the shell are portable across emulators; changes to the emulator affect fonts, colors, and window behavior but not what the shell does.
Install Oh My Zsh
Oh My Zsh is the most popular zsh framework. It gives you themes, hundreds of plugins, and sensible defaults in one install.
After installation, open ~/.zshrc in your editor:
Pick a Theme
Themes control your prompt — the line that appears before you type each command. A good prompt shows your current directory, git branch, and command exit status without being noisy. Popular choices include agnoster, robbyrussell (the default), and the ultra-fast standalone powerlevel10k.
For powerlevel10k, which runs a one-time wizard to style your prompt exactly how you want:
Then set ZSH_THEME="powerlevel10k/powerlevel10k" and open a new Terminal to launch the wizard.
Enable Plugins
Plugins add autocompletion, syntax highlighting, suggestions, and shortcuts. Two must-haves are zsh-autosuggestions (greys out suggestions as you type based on your history) and zsh-syntax-highlighting (colors commands green when valid, red when not). Install them:
Then edit the plugins=(...) line in your ~/.zshrc to enable them:
The git plugin alone gives you dozens of handy aliases like gst (git status), gcm (git commit -m), and gpl (git pull). The macos plugin adds helpers like showfiles/hidefiles to toggle hidden files in Finder.
Tune the Prompt and History
Add these lines to the bottom of ~/.zshrc for a more useful shell: a much larger history, sensible history behaviour, and some quality-of-life settings.
Reload your config without opening a new tab:
Pick a Better Emulator
Terminal.app is fine, but iTerm2 adds split panes, hotkey window, triggers, and much better search. Warp and Ghostty are modern GPU-accelerated alternatives with AI command suggestions and a cleaner UX. All of them are free. Choose whichever matches your taste — your zsh config will follow you.
3. Homebrew — The Missing Package Manager
Homebrew is the de facto standard for installing command-line tools, open-source apps, fonts, and even full GUI applications on macOS. Instead of hunting down installers, dragging DMGs, and manually updating each app, you install everything with a single command and update everything with another. For developers and power users, Homebrew is non-negotiable.
Homebrew installs into /opt/homebrew on Apple Silicon Macs and /usr/local on Intel Macs. It never touches system files, which means you can uninstall it cleanly, and it automatically updates its own package database when you run brew update.
Install Homebrew
After installation, the installer will tell you to run two lines to add Homebrew to your PATH. Follow them exactly, or Homebrew's binaries won't be found. On Apple Silicon this looks like:
Everyday Brew Commands
Install any CLI tool with brew install. For example, grab a modern replacement for cat, a fuzzy finder, and a JSON processor:
Refresh the package database before any install or upgrade — this is cheap and takes a few seconds:
Upgrade every installed package to the latest version:
Remove old versions and free up disk space:
Check for a broken install or missing dependency:
Casks — Full GUI Apps
Add --cask and Homebrew installs full GUI apps the same way, dropping them into /Applications. This is the fastest way to set up a fresh Mac.
Taps and Bundles
Some packages live outside the main Homebrew repository. A tap is a third-party repository you add with brew tap.
For reproducible setups across machines, save a Brewfile and reinstall everything with one command on a new Mac:
4. Aliases and Functions — Make the Shell Yours
An alias is a short name for a longer command. A function is an alias with arguments and logic. Together they let you compress the commands you type most into one or two keystrokes, and they are stored in plain text in ~/.zshrc, so they travel with your dotfiles. The goal isn't to memorise aliases from someone else's list — it's to notice which commands you keep retyping and encode them.
Useful Aliases
Drop these into the bottom of your ~/.zshrc, then run source ~/.zshrc to load them. Many of them replace common commands with safer or richer versions.
After reloading, you can type ll to get a rich directory listing with git status and icons (requires eza and a Nerd Font), ... to jump up two directories, gs to see your git status, or flushdns to clear the DNS cache in one command.
Shell Functions
Aliases can't take arguments or run multi-step logic. Functions can. Here are three that pay for themselves every week.
mkcd — make a directory and immediately enter it:
extract — unpack any archive without memorising flags:
killport — kill whatever process is holding a port hostage (common when a dev server crashes):
history | grep docker | tail -20 finds your last docker commands; du -sh * | sort -h | tail shows the biggest items in a directory; pbpaste | jq . pretty-prints JSON from your clipboard. Every pipe is a tiny program you built in one line.
5. Useful Scripts You Can Steal Today
Once a workflow is longer than two lines, promote it from an alias to a script. Create a ~/bin directory, add it to your PATH, drop .sh files inside, mark them executable with chmod +x, and they become first-class commands you can call by name from anywhere.
Batch Rename Files with a Prefix
Save as ~/bin/prefix-rename, then run prefix-rename photo_ *.jpg to prefix every JPEG in the current folder with photo_.
Timestamped Backup of a Folder
Save as ~/bin/snap. Running snap ~/Projects/raylaunchmac produces a zipped snapshot in ~/Backups with the date and time in the filename.
Disk Usage Report
Save as ~/bin/diskreport. Run it with no arguments to list the ten largest items in the current directory, their sizes, and the free space on your boot volume. Perfect for a quick "what's eating my disk?" check.
Weather in the Terminal
Save as ~/bin/wx. Run wx for your local forecast, or wx Berlin for anywhere else. It uses the free wttr.in service — no API key required.
Make each script executable in one command and you're done:
Those four little files replace at least a dozen Finder sessions a week. That's the point of the Terminal: small composable commands, a shell tuned to your fingers, a package manager for everything else, and a growing personal library of aliases and scripts. Spend a weekend setting it up and you'll feel the difference every working day for years. The commands and scripts in this guide are just the starting kit — your own best tools will be the ones you write to scratch your own itches.