Command Line Screen Recording and Screenshot from Mac OS Terminal

Command Line Screen Recording and Screenshot from Mac OS Terminal post thumbnail image

The most common query is to take screenshot on Mac OS using it graphical user interface. You can find that blog at:

Record Screen or Take Screenshot on Mac OS Quick Overview

If you want to take screenshot from Mac OS command line, following are the links which can help you reach the right section for your query:

Quick Tip: In case the taking screenshot gives you blank desktop without proper screen and windows please check following section:

Enable terminal to record the content of screen

Take screenshot of full screen:

The command line utility “screencapture” takes screenshot from terminal. Running the command with file name will save the screenshot of full desktop in the file.

screencapture Desktop/filename.png

Take screenshot of selected area of screen:

Running screencapture command with option -i will convert the mouse pointer into a crosshair which will let you select the portion of the screen.

screencapture -i Desktop/filename.png

Selecting the portion like below:

Will create screenshot like below:

Take screenshot of specific window:

Running screencapture command with option -i will convert the mouse pointer into a crosshair . Press space to convert crosshair into camera symbol which can be used to select any of the opened window or run the command with ‘-w’ option.

screencapture -i Desktop/filename.png

and press space or

screencapture -w Desktop/filename.png

Clicking the window will take its screenshot, which look like below you can see the terminal isn’t visible in screenshot:

Recording Screen:

Use the following command to start video recording:

screencapture -v Desktop/filename.png

and click ctrl+c to stop recording:

Taking help on screencapture utility:

One can open manual pages for taking help on screencapture command line utility using following command:

man screencapture

Above command will open a full screen command line manual which can be read by pressing up and down arrow keys and one can quit manual by clicking button ‘q’.

Enable Terminal to Record the Content of Screen:

If after taking screenshot using screencapture command line tool you are only getting image of a blank desktop like below screen, you need to make some changes in system settings:

Open submenu “System Preferences” under apple (  ) menu:

Click on “Security and Privacy”:

Click “Screen Recording” option under left menu and click on “🔒Click the lock to make changes.”

This will ask for your password to make the changes in settings:

This will allow you to change the settings. Select or deselect the “Terminal” in order to allow or disallow it from recording screen. Any opened terminals need to be closed and reopened in order for these settings to take effect.

Close the window after making changes in settings.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post