• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How To Install Scrot - Take A Screenshots Automatically in Linux

{{postValue.id}}

To take Desktop/Server screenshots automatically using Scrot

Scrot is a command line tool which is powerfull and flexible for capturing screenshots of desktop and server by cron job. It is the same as import command which uses imlib2 to capture images. Procedure to take Desktop/Server screenshots automatically using Scrot is explained in this article.

Features

  • It is easy to use and install.
  • The quality of the screenshots image can be optimized with -q switch.
  • Particular window or area can be captured.
  • Screenshots can be stored in particular directory in remote PC or server.
  • Used to monitor PC to prevent unwanted actions.

To install Scrot

The yum and apt-get command is used to install the packages on RedHat or Debian based distribution.

On RedHat based Systems

# yum install scrot

To install from source code, execute the following commands

# wget http://linuxbrit.co.uk/downloads/scrot-0.8.tar.gz
# tar -xvf scrot-0.8.tar.gz
# cd /scrot-0.8
# ./configure
# make
# " make install" 

RedHat users should specify the prefix location using configure command.

On Ubuntu based Systems

user1@linuxhelp:~$ sudo apt-get install scrot
[sudo] password for user1: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  giblib1 libgif7 libid3tag0 libimlib2
The following NEW packages will be installed:
  giblib1 libgif7 libid3tag0 libimlib2 scrot
0 upgraded, 5 newly installed, 0 to remove and 92 not upgraded.
Need to get 264 kB of archives.
After this operation, 904 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
.
.
. 
Setting up scrot (0.8-17) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...

Take a screenshot of the whole desktop

Open a terminal and type scrot, then hit Enter.

user1@linuxhelp:~$ scrot
user1@linuxhelp:~$ ls -l
total 112
-rw-rw-r-- 1 user1 user1 68163 Jun 22 03:26 2016-06-22-032655_800x600_scrot.png
drwxr-xr-x 2 user1 user1  4096 Jun  1 00:33 Desktop
drwxr-xr-x 2 user1 user1  4096 Jun  1 05:53 Documents
drwxr-xr-x 2 user1 user1  4096 Jun  1 05:53 Downloads
-rw-r--r-- 1 user1 user1  8980 Jun  1 05:46 examples.desktop
drwxr-xr-x 2 user1 user1  4096 Jun  1 05:53 Music
drwxr-xr-x 2 user1 user1  4096 Jun  1 05:53 Pictures
drwxr-xr-x 2 user1 user1  4096 Jun  1 05:53 Public
drwxr-xr-x 2 user1 user1  4096 Jun  1 05:53 Templates
drwxr-xr-x 2 user1 user1  4096 Jun  1 05:53 Videos

The image captured will be stored in the current directory and by default its name will be in the following format.

filename_date_and_time_screen resolution_scrot.png

Also you can specify the name of your choice and image type by using this command

user1@linuxhelp:~$ scrot ~/Pictures/linuxhelp.jpg
user1@linuxhelp:~$ 
user1@linuxhelp:~$ cd Pictures/
user1@linuxhelp:~/Pictures$ ls -l
total 28
-rw-rw-r-- 1 user1 user1 26143 Jun 22 03:32 linuxhelp.jpg

The above command will capture the full desktop and save it in Pictures folder with the name linuxhelp and image type as jpg.

It also allows you to take screenshot of any selected area of the screen.

Type the command below in the terminal and hit Enter.

user1@linuxhelp:~/Pictures$ scrot -s
user1@linuxhelp:~/Pictures$ ls -l
total 76
-rw-rw-r-- 1 user1 user1 46782 Jun 22 03:40 2016-06-22-034042_735x387_scrot.png
-rw-rw-r-- 1 user1 user1 26143 Jun 22 03:32 linuxhelp.jpg

After hitting enter, drag the mouse over the area to capture and release the button.
terminal

To take a screenshot of the whole screen after a specific time, add the “ -d” (delay) argument to the scrot command with the delay time . To take a screenshot in 8 seconds, use the following format.

user1@linuxhelp:~/Pictures$ scrot -d 8 example.jpg
user1@linuxhelp:~/Pictures$ 
user1@linuxhelp:~/Pictures$ ls -l
total 104
-rw-rw-r-- 1 user1 user1 46782 Jun 22 03:40 2016-06-22-034042_735x387_scrot.png
-rw-rw-r-- 1 user1 user1 26232 Jun 22 03:44 example.jpg
-rw-rw-r-- 1 user1 user1 26143 Jun 22 03:32 linuxhelp.jpg

This will capture the whole screen exactly after 7 seconds and save it in the current directory with the name example.jpg. You can also use the parameter “ -c” in addition to “ -d” to print countdown to screenshot in the terminal.

user1@linuxhelp:~/Pictures$ scrot -d 8 -c desktop.png
Taking shot in 8.. 7.. 6.. 5.. 4.. 3.. 2.. 1.. 0.
user1@linuxhelp:~/Pictures$ 
user1@linuxhelp:~/Pictures$ ls -l
total 180
-rw-rw-r-- 1 user1 user1 46782 Jun 22 03:40 2016-06-22-034042_735x387_scrot.png
-rw-rw-r-- 1 user1 user1 75392 Jun 22 03:55 desktop.png
-rw-rw-r-- 1 user1 user1 26232 Jun 22 03:44 example.jpg
-rw-rw-r-- 1 user1 user1 26143 Jun 22 03:32 linuxhelp.jpg

It starts count down in descending order, once it reaches 0- a screenshot is taken.

To install GIMP Package

user1@linuxhelp:~/Pictures$ sudo apt-get install gimp
[sudo] password for user1: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  gimp-data libamd2.4.1 libbabl-0.1-0 libblas-common libblas3
.
.
Setting up gimp (2.8.16-1ubuntu1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...

You can also take a screenshot, open and edit it on the go using GIMP by combining two commands as follows.

user1@linuxhelp:~/Pictures$ scrot -q 90 -d 7 linuxhelp1.png & &  gimp linuxhelp1.png & 
[1] 4929

Explanations

The first command&rarr One for taking the screenshot with scrot (scrot -q 90 -d 7 linuxhelp1.png)

The second command&rarr is for opening the newly created screenshot image on GIMP (gimp unixmen.png).

The AND logic operator (& & ) &rarr tells the terminal “ If the first command is true, then perform the second one” .
screenshot

GIMP image editor

manage settings

Tags:
noah
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

How to make linux ubuntu show dual screens?

A

You can enable the dual screens from the Ubuntu display i.e System -> Preferences -> Display

Q

How to take the screenshot of particular website like google or any monitoring tool like backup.

A

You can use shutter tool to take screenshot of any window or selected portion of windows.

Q

How to install Scrot On RedHat based Systems?

A

install Scrot On RedHat based Systems using the following command

yum install scrot

Q

How to install scrot On Ubuntu based Systems?

A

install scrot On Ubuntu based Systems using the following command

install scrot On Ubuntu based Systems

Q

How to Take a screenshot of the whole desktop?

A

to Take a screenshot of the whole desktop Open a terminal and type scrot, then hit Enter.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Gibbson ?
How do i run both nginx and apache in same instance on centos

Hi...,

my server is based centos operating system and my webserver is already running on Apache.... i need to run both apache and nginx on same instance ... please help me to implement this concept...

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.