Capture a Screen Region to a File with screencapture -R

Screenshot an exact x,y,width,height rectangle silently, ideal for scripts and repeatable documentation shots.

macOSmacosScreenshotFilescliLow risk
Run `screencapture -x -R 100,100,900,600 ~/Desktop/crop.png` to save a 900×600 region starting at pixel (100,100).

01Command

Command
$ screencapture -x -R 100,100,900,600 ~/Desktop/crop.png

02What it does

The -R flag takes a rectangle in x,y,width,height order measured from the top-left of the main display, so you can re-shoot the exact same area after UI changes — perfect for before/after comparisons and automated docs. -x suppresses the shutter sound for silent capture in shared spaces or scripts. The output file format follows the extension you give (.png, .jpg, .tiff). For Retina displays the saved file is in pixels at 2× scale unless you post-process.

03Risk

RiskLow risk
RequirementsScreen Recording permission for the calling Terminal app (macOS 10.15+).
!Warning: The first time you run this from Terminal, macOS asks for Screen Recording permission — grant it to the Terminal app or you will get blank/desktop-only images.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • screencapture - Create a screenshot of the display
    SS64 · technical · 2026-09-17
    Evidence: Documents `-x Do not play sounds.` and `-R <x,y,w,h>`: capture a rectangle using format x,y,width,height.
  • screencapture(1) man page
    Xcode Man Pages (keith.github.io) · technical · 2026-09-17
    Evidence: Man page for screencapture listing `-R<x,y,w,h>` (capture a rectangle at the given coordinates) and `-x` (do not play sounds) among its options.

Last verified: 2026-09-19 · Category: Media

06Related solutions