Screenshots on macOS

Keyboard shortcuts

You can capture the entire screen, a window, or just a portion of the screen.

  • ⌘ + ⇧ + 3 Capture the whole screen.
  • ⌘ + ⇧ + 4 Capture a selection.
  • ⌘ + ⇧ + 4 + Space Capture a window.
  • ⌘ + ⇧ + 5 Capture the whole screen, a selection or a window.

See more information in Take a screenshot on your Mac.

Command line

Command line tool that capture an image of the whole, or part of the screen.

screencapture -ioW ~/Desktop/screenshot.png
  • -i Capture screen interactively, by selection or window.
  • -W Start interaction in window selection mode.
  • -o In window capture mode, do not capture the shadow of the window.

More information in screencapture manual page.

Change default settings of screencapture

defaults write name "Screenshot"

Disable shadow in screenshots:

defaults write disable-shadow -bool true

Save screenshots to the ~/Downloads

defaults write location -string "${HOME}/Downloads"

Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)

defaults write type -string "png"

Disable datetime in screenshots filename

defaults write include-date -bool false

To apply the changes, you need to restart the SystemUIServer:

killall SystemUIServer

Capture website with Google Chrome

/Applications/Google\\ Chrome \ 
  --headless --disable-gpu \ 
  --screenshot --hide-scrollbars --virtual-time-budget=2000 \
  --window-size=1920,1428 \

or you can print website to PDF:

/Applications/Google\\ Chrome \ 
  --headless --disable-gpu \
  --no-pdf-header-footer --no-margins \ 
  --virtual-time-budget=2000 \
  --print-to-pdf="~/Downloads/apple.pdf" \