Take Screenshots Directly From The Terminal In Linux Mint/Ubuntu

Scrot is a command line utility that can directly take screenshots from the Terminal.

To install it in Ubuntu/Linux Mint, open Terminal and type the following :

sudo apt install scrot

Once installed, it is easy to use.

To directly take a screenshot of the Terminal :


What this will do is save the screenshot with a timestamp in the current directory.

scrot utility to take screenshots from Linux Terminal

To save a screenshot in other location :

scrot locationpath

So for example, to save a screenshot of the Terminal to the Pictures folder in the home directory and name it as term.jpg, the command will be :

scrot ~/Pictures/term.jpg

saving screenshots to a specific location using scrot

Scrot can also be used to take a screenshot of any window, not just the Terminal. To do that, use the delay parameter with the number of seconds as delay time :

scrot -d 10 ~/Pictures/test.jpg

The above command will after a delay of 10 seconds take a screenshot of the currently active window with focus. The screenshot will be saved as test.jpg in Pictures folder of the home directory.

screenshot of the current window with focus taken with scrot

You can also take a screenshot of the entire desktop, simply set a delay timer and then minimize all the windows. Also, it can be useful to have a countdown timer when using this delay option. The count parameter does just that.

So, to take a screenshot after a delay of 15 seconds with countdown display and save it in current directory with timestamp, the command will be :

scrot -d 15 -c

using delay and countdown parameters in scrot for screenshots

To save it in a different directory with a preferred file name :

scrot -d 15 -c  /home/avp/Documents/dd.png

saving screenshot to a specific location after delayed capture with countdown

There are other parameters too like for running an application on the saved screenshot, interactively selecting a window, generating screenshot thumbnails and so on.

A detailed list can be viewed using the man command :

man scrot

man pages for scrot screenshot tool in Linux Mint/Ubuntu

This is a handy command line tool for taking basic screenshots. If you want a graphical interface, the default screenshot tool can also be quite useful.

All done.

Comments are closed.