25 Essential Mac Terminal Commands
You don't need to live in the Terminal to benefit from it. These 25 commands cover the everyday jobs — finding your way around, moving files, checking what your Mac is doing — plus the Mac-only extras that make macOS's Terminal genuinely fun. Each one works identically on macOS 13 Ventura through 15 Sequoia.
Moving around
pwd— print the folder you're currently in.ls— list the files here;ls -laadds hidden files, sizes, and permissions.cd— change folder:cd ~/Downloads,cd ..to go up one level, plaincdto jump home.clear— wipe the screen (or press Cmd-K).man— the built-in manual:man lsexplains every flaglstakes. Press q to exit.open .— the escape hatch: opens the folder you're standing in as a Finder window.
Managing files
mkdir— create a folder:mkdir Invoices; add-pto create nested paths in one go.touch— create an empty file:touch notes.txt.cp— copy:cp report.pdf ~/Desktop/; use-Rfor folders.mv— move or rename:mv draft.txt final.txt.cat— print a file's contents to the screen.nano— a friendly in-Terminal text editor; Ctrl-O saves, Ctrl-X quits.rm— delete a file. Handle with care:rmdoes not use the Trash. There is no undo. Double-check the path, and be triple-careful withrm -ron folders.
Checking your system
When your Mac feels slow or full, these answer why — the same numbers Activity Monitor shows, seconds faster:
grep— search inside files:grep -ri "invoice" ~/Documents.find— locate files by name or attribute:find . -name "*.pdf".df -h— free space on each volume.du -sh *— how much each item in the current folder weighs.top -o cpu— a live view of what's eating your CPU; press q to quit.ping -c 5 1.1.1.1— five quick packets to test whether your internet connection is alive.killall— restart a process by name:killall Dockorkillall Finderrelaunch instantly and are the standard way to apply settings tweaks.
The Mac-only gems
These five don't exist on generic Unix — they're macOS specials, and they're the reason Mac users end up loving the Terminal:
open— launch anything:open report.pdf,open -a Preview photo.png,open https://trymainspring.com.pbcopy/pbpaste— pipe text to and from the clipboard:ls | pbcopyputs a file listing straight on your clipboard.caffeinate— keep your Mac awake while a command runs:caffeinate -i ./backup.sh, or plaincaffeinateuntil you press Ctrl-C.say— your Mac speaks:say "build finished". Chain it after a slow command —make build && say done— and go get coffee.defaults— read and write the hidden preferences behind macOS apps. This one unlocks a whole world of tweaks; start with our guide to defaults write.
One habit ties all 25 together: when in doubt, check man before you run something unfamiliar, and never paste a command from the internet — especially one starting with sudo — without knowing what it does.
Habits that make every command faster
Two built-in behaviors multiply everything above. Tab completion: type the first few letters of a file or folder name and press Tab — the shell fills in the rest, killing most typos before they happen. History: the up arrow recalls previous commands, and Ctrl-R searches everything you've typed for a fragment you remember.
Add two rescue moves and you're set. Ctrl-C cancels whatever is running, so a wrong command rarely gets far. And dragging a file from a Finder window into Terminal pastes its full path at the cursor — the easiest way to point a command at something buried six folders deep. All of it works out of the box in the default zsh shell on macOS 13 through 15.
The best Terminal tweaks are settings changes in disguise. Mainspring turns 90+ hidden macOS settings into labelled, reversible toggles — the power of defaults write without memorizing a single command.
Signed & notarized by Apple · 1-day free trial · $29 once