Command-line tools built into macOS
Terminal tools every Mac already has: resize photos, search with Spotlight, convert documents, zip like Finder, verify downloads. Tested on macOS 27.
Every Mac comes with dozens of command-line tools that most people never hear of: one resizes and converts photos, one searches with Spotlight, one converts Word documents, one zips folders exactly the way Finder does. You run them in Terminal (in Applications > Utilities) by typing a line and pressing Return. Nothing to install.
I ran the examples in this guide on macOS 27.2 on an Apple silicon Mac, on test files made for the purpose, and the output shown is what came back. The few I didn’t run are marked.
The twelve worth knowing first
| Tool | What it does | Example |
|---|---|---|
sips | Resize and convert images | sips -Z 1600 photo.heic -s format jpeg --out photo.jpg |
mdfind | Spotlight search, including text inside documents | mdfind -onlyin ~/Documents "quarterly report" 2>/dev/null |
caffeinate | Keep the Mac awake while something runs | caffeinate -i ./backup.sh |
pbcopy, pbpaste | Copy to and paste from the clipboard | pbpaste | tr a-z A-Z | pbcopy |
textutil | Convert txt, rtf, html, docx, odt | textutil -convert docx notes.rtf -output notes.docx |
say | Text to speech, or to an audio file | say -o hello.aiff "Backup finished" |
networkQuality | Speed and responsiveness test | networkQuality -s |
ditto | Copy and zip the way Finder does | ditto -c -k --sequesterRsrc --keepParent Project Project.zip |
screencapture | Screenshots from a script | screencapture -x -R 0,0,800,600 shot.png |
qlmanage | Quick Look thumbnails of images, PDFs and documents | mkdir -p thumbs && qlmanage -t -s 256 -o thumbs report.pdf |
shasum | Check a download against its published hash | shasum -a 256 -c file.dmg.sha256 |
sw_vers, system_profiler | Which macOS and which Mac | sw_vers -productVersion |
The pages in this guide cover each one with tested examples and the traps:
- Files and images:
sips,textutil,ditto, Apple Archive,qlmanage, checksums and extended attributes. - Everyday tools: Spotlight, the clipboard, keeping the Mac awake, speech, screenshots and a network test.
- System information: macOS and hardware details, disks, logs, property lists and settings, read-only.
Before you start
- Some tools change files in place.
sipswithout--outandplutil -convertwithout-ooverwrite the original. The examples here always write a new file; try anything else on copies first. - Some write nothing without saying much.
qlmanage -o thumbsreported “produced one thumbnail” and wrote nothing when thethumbsfolder didn’t exist. Check that the output is there. - zsh has its own
logcommand. In the default shell,log showfails with “too many arguments”; type/usr/bin/log showinstead. - A few ask for permission.
screencaptureneeds Screen Recording for Terminal, andosascriptscripts that control other apps ask for Automation access the first time. The examples here avoid the second. manexplains any tool:man sips. Most tools also print their options when given one they don’t recognize.
Related
- Automate your Mac: Shortcuts, AppleScript and Automator, which can all run these tools
Files and images Resize and convert photos with sips, convert Word files with textutil, zip like Finder with ditto, and verify downloads, using tools every Mac has.
Everyday tools Search with Spotlight from Terminal, use the clipboard, keep the Mac awake, make speech files, take screenshots and test your network, all built in.
System information Find your macOS version, Mac model, disks, FileVault status, logs and app settings from Terminal, with read-only commands tested on macOS 27.