Take timed or scripted screenshots from Terminal — via Apple (man page mirror by Keith Smiley)
The built-in screencapture command can do things the toolbar can't easily: a silent capture after a delay, a capture of an exact rectangle, or one that opens straight in Preview. Useful for capturing menus or hover states, and for scripts.
Takes effect right away
The easy way
- The example waits 5 seconds (
-T 5), captures only the main display (-m), skips the camera sound (-x) and saves todelayed-shot.pngon the desktop. Pick a file name that doesn't exist yet, or the old file is replaced. - Other handy options:
-iinteractive selection,-cto the clipboard,-Popen in Preview,-R x,y,w,ha fixed rectangle,-ono window shadow,-vrecord video. - Run
screencapture -helpfor the full list.
Command
Run in Terminal (Applications › Utilities).
screencapture -m -T 5 -x ~/Desktop/delayed-shot.pngWithout-m, a full-screen capture on a Mac with several displays saves one file per screen, so you'd list one file name per display (or use-D 2to pick a specific display). The first time, macOS may ask you to allow Terminal to record the screen in System Settings > Privacy & Security. To undo, delete the screenshot file(s) you created.
Sources
- screencapture(1) man page — by Apple (man page mirror by Keith Smiley)
- screencapture — by SS64
- Source reviewed
- 2026-11-02
- Link checked
- 2026-11-02
- Tested hands-on
- Not by Oddbyte.Me
Oddbyte.Me hasn't tried this on every macOS version, so keep the undo handy.