If you wish to take a screen shot on a Linux system, whether it is a CentOS,
Ubuntu, or other Linux distribution, one tool that may already be on the
system that will allow you to perform a screen capture from a command line
interface, i.e., a shell prompt, is
. You can determine if the utility is present on a
system using the which
$ which gnome-screenshot
You can obtain help on using the tool to take a screenshot by typing
gnome-screenshot at a shell prompt.
$ gnome-screenshot --help
gnome-screenshot [OPTION...] Take a picture of the screen
-h, --help Show help options
--help-all Show all help options
--help-gtk Show GTK+ Options
-c, --clipboard Send the grab directly to the clipboard
-w, --window Grab a window instead of the entire screen
-a, --area Grab an area of the screen instead of the entire screen
-b, --include-border Include the window border with the screenshot
-B, --remove-border Remove the window border from the screenshot
-d, --delay=seconds Take screenshot after specified delay [in seconds]
-e, --border-effect=effect Effect to add to the border (shadow, border or none)
-i, --interactive Interactively set options
--display=DISPLAY X display to use
Taking a screenshot with scrot
is a command line
screen capturing application for Linux systems developed by Tom Gilbert.
If the package is installed, you can type
to take a snapshot of the screen and store it in
the file named imagefile
. If you
don't want the terminal window from which you ran the command captured in
the screenshot, you can issue the
command followed by
some delay in seconds followed by a semicolon and then the scrot command
to give you time to minimize the terminal window from which you ran the
$ sleep 10; scrot test.png
The above command would give you 10 seconds to minimize the terminal
window and any other open windows you didn't want to see in the screenshot.
The results of the screenshot would be stored in the directory from which
the command was run in the file
test.png. Or you can use
the scrot command's own delay parameter,
followed by the number of seconds of delay you wish to give yourself
before scrot captures the screen, e.g.,
scrot -d 10.
For help on the utility issue the command
Usage : scrot [OPTIONS]... [FILE]
Where FILE is the target file for the screenshot.
If FILE is not specified, a date-stamped file will be dropped in the
See man scrot for more details
-h, --help display this help and exit
-v, --version output version information and exit
-b, --border When selecting a window, grab wm border too
-c, --count show a countdown before taking the shot
-d, --delay NUM wait NUM seconds before taking a shot
-e, --exec APP run APP on the resulting screenshot
-q, --quality NUM Image quality (1-100) high value means
high size, low compression. Default: 75.
For lossless compression formats, like png,
low quality means high compression.
-m, --multidisp For multiple heads, grab shot from each
and join them together.
-s, --select interactively choose a window or rectangle
with the mouse
-u, --focused use the currently focused window
-t, --thumb NUM generate thumbnail too. NUM is the percentage
of the original size for the thumbnail to be,
or the geometry in percent, e.g. 50x60 or 80x20.
-z, --silent Prevent beeping
Both the --exec and filename parameters can take format specifiers
that are expanded by scrot when encountered.
There are two types of format specifier. Characters preceded by a '%'
are interpreted by strftime(2). See man strftime for examples.
These options may be used to refer to the current date and time.
The second kind are internal to scrot and are prefixed by '$'
The following specifiers are recognised:
$f image path/filename (ignored when used in the filename)
$m thumbnail path/filename
$n image name (ignored when used in the filename)
$s image size (bytes) (ignored when used in the filename)
$p image pixel size
$w image width
$h image height
$t image format
$$ prints a literal '$'
\n prints a newline (ignored when used in the filename)
scrot '%Y-%m-%d_$wx$h_scrot.png' -e 'mv $f ~/images/shots/'
Creates a file called something like 2000-10-30_2560x1024_scrot.png
and moves it to your images directory.
This program is free software see the file COPYING for licensing info.
Copyright Tom Gilbert 2000
Email bugs to <firstname.lastname@example.org>
You can also type
man scrot to see information on use
of the utility.
Wikipedia, the free encyclopedia
The Tom Gilbert Blog