Sourced command reference · 3 min read
Mac screencapture commands: a safe starting guide
A local macOS screencapture flag reference with explicit paths, Clipboard modes, and bounded automation.
macOS includes a command-line utility named screencapture. The local macOS manual is the primary reference for its flags. Use it when a repeatable file path or a scripted region is more useful than a keyboard shortcut.
The examples below were not executed as part of this article review.
Save a full-screen capture
Use an explicit output path:
mkdir -p "$HOME/Screenshots"
screencapture -m "$HOME/Screenshots/full-screen.png"
The first command creates the folder. The second captures only the main monitor, selected by -m, and writes the image there. Without a display selector, macOS can produce a separate file for each screen. Choose a new filename when you want to preserve an earlier image.
Select a region or window
screencapture -i "$HOME/Screenshots/selection.png"
screencapture -W "$HOME/Screenshots/window.png"
screencapture -W -o "$HOME/Screenshots/window-no-shadow.png"
The -i flag starts interactive selection. The -W flag starts window-selection mode. The -o flag omits the window shadow.
To capture a fixed rectangle, use x, y, width, and height:
screencapture -R 100,200,800,600 "$HOME/Screenshots/region.png"
These values describe the rectangle passed to the command. They do not promise a fixed output size across every display scale or capture format.
Send the result to the Clipboard
screencapture -c -i
screencapture -c -W
The first command interactively selects an area and sends it to the Clipboard. The second selects a window and sends it to the Clipboard. Paste with Command-V.
Add a delay or choose a display
screencapture -T 5 -i "$HOME/Screenshots/delayed.png"
screencapture -D 2 "$HOME/Screenshots/second-display.png"
-T adds a delay in seconds before the capture. -D selects a display number. Confirm the target on your Mac before building a script around display numbering.
Choose format or suppress sound
screencapture -m -t jpg "$HOME/Screenshots/capture.jpg"
screencapture -m -x "$HOME/Screenshots/silent.png"
The local manual documents -t for the image format and -x to suppress capture sounds. A command-line format choice is per capture; it is separate from Screenshot’s HDR/SDR setting on supported Macs using macOS Tahoe 26 or later.
Keep automation bounded
An unbounded while-true loop can fill a disk with screenshots. If you need a time-lapse, capture only the main monitor with a fixed count and a named output directory, then review the files before increasing the run:
mkdir -p "$HOME/Screenshots/timelapse"
for i in 1 2 3 4 5; do
file="$HOME/Screenshots/timelapse/capture-$(date +%Y%m%d-%H%M%S)-$i.png"
screencapture -m -x "$file"
sleep 30
done
Do not add upload, repository-commit, or external API commands to a basic capture example. They turn a local screenshot recipe into an external write and require separate review.
Permission and blank output
If a third-party terminal app cannot capture, check System Settings > Privacy & Security > Screen & System Audio Recording and enable that exact terminal app if macOS requests it. Test a normal window first; Apple notes that some apps may not allow screenshots of their windows.
Related guides: How to take a partial screenshot on Mac · Mac screenshot settings: location, format, and file names.
Source note: the local macOS screencapture manual, Apple Support: Take a screenshot on Mac, Apple User Guide: Allow apps to use screen and audio recording, retrieved September 20, 2026.
Disclosure
Ali owns LazyScreenshots. That creates a conflict when he writes about LazyScreenshots or reviews competitors, so relevant pieces say so plainly. These articles are research and opinion, not independent third-party ratings.