Skip to content

screencapture MacOS command

The MacOS screencapture command is a powerful tool that allows users to take screenshots directly from the command line. This tool offers various options for capturing screenshots, such as selecting a specific area, capturing a window, including or excluding the cursor, and setting a delay timer. Users can also choose the file format and location to save the screenshot. The screencapture command provides a convenient way to capture your screen without having to rely on third-party applications.

screencapture Syntax:

Terminal window
screencapture [options] [file]

screencapture Options:

OptionDescription
-cForce the screen capture to go to the clipboard.
-T secondsTake the picture after a delay of seconds.
-t typeImage format to create (default is png).
-oOpen the captured image with Preview.
-iCapture a screen image of an interactive window.
-sOnly allow mouse selection mode.

Parameters:

ParameterDescription
fileSpecify the file destination for the screen capture.

screencapture Command Usage Examples:

Capture the Entire Screen

Terminal window
screencapture screenshot.png

Capture the entire screen and save it as a PNG file named “screenshot.png”.

Capture a Selected Window

Terminal window
screencapture -o -W window.png

Capture the selected window and save it as a PNG file named “window.png”.

Capture a Timed Screenshot

Terminal window
screencapture -T 5 timed.png

Capture the screen after a 5-second delay and save it as a PNG file named “timed.png”.

Capture a Specific Region

Terminal window
screencapture -R30,50,500,400 region.png

Capture a specific region starting at coordinates (30, 50) and save it as a PNG file named “region.png”.

Capture Screen and Open in Preview

Terminal window
screencapture -P preview.png

Capture the screen and open the image in Preview for viewing and editing.

How do I use screencapture in MacOS?

To use the screencapture command in bash, execute the following command:

Terminal window
screencapture -i screenshot.png

What is the syntax for capturing a selected portion of the screen?

To capture a selected portion of the screen with the screencapture command in MacOS, use the following syntax:

Terminal window
screencapture -s selection.png

How can I capture the screen and open the captured image in a specific application?

To capture the screen with the screencapture command in MacOS and open the captured image in a specific application, use the following command:

Terminal window
screencapture -o -a -e open -a Preview screenshot.png

Is it possible to capture the screen after a delay using screencapture?

Yes, you can capture the screen after a delay using the screencapture command in MacOS. Here is an example command:

Terminal window
screencapture -T 5 delayed.png

How can I capture the screen and play a sound when the capture is complete?

To capture the screen with the screencapture command in MacOS and play a sound when the capture is complete, use the following command:

Terminal window
screencapture -x -m screenshot.png && afplay /System/Library/Sounds/Ping.aiff

What is the command to capture the screen without the shadow effect?

To capture the screen without the shadow effect using the screencapture command in MacOS, execute the following command:

Terminal window
screencapture -o screenshot.png

How do I capture the screen and copy the screenshot to the clipboard?

To capture the screen and copy the screenshot to the clipboard using the screencapture command in MacOS, use the following command:

Terminal window
screencapture -c screenshot.png

Can I capture the screen and save the screenshot in a specific folder?

Yes, you can capture the screen and save the screenshot in a specific folder by specifying the path. Here is an example command:

Terminal window
screencapture -o ~/Desktop/screenshots/screenshot.png

Applications of the screencapture command

  • Taking screenshots of the entire screen
  • Capturing a specific window or region on the screen
  • Setting a delay before capturing the screen
  • Saving the screenshot to a specified location
  • Copying the screenshot to the clipboard
  • Capturing the screen and opening the screenshot in a specific application