There are many Linux applications dedicated to taking screen shots. However, you might want to use the command line to do this, either because you want to build an automated script, or because you have a terminal screen handy.
Scrot (SCReenshOT) will probably not come pre-installed with your distro; so, as ever, it is a case of a quick visit to the software repositories. If that turns up a blank you should be able to download a source tarball or a pre-compiled binary at the official site.
This is not the place to launch into a detailed comparison of available screen shot tools, graphical or command line. Scrot despite being a command-line tool, offers the user an excellent screen shot tool with power options to suit most requirements. Scrot is a command-line tool (written in C and using the imlib2 library); so obviously you will be running it in a console within your X windows session.
Install
For Ubuntu/Debian:
$ sudo aptitude install scrot
For Fedora/CentOS:
$ yum install scrot
Usage
Syntax:
$ scrot mypicturefile
Example
Delay of 4 seconds between launching the command and saving the screenshot.png file.
$ scrot -d 4 screenshot.png
Display a countdown in the console.
$ scrot -c -d 4 screenshot.png
Save a JPG file with a quality of 80%.
$ scrot -q 80 -c -d 4 screenshot.jpg
You can also use special strings with scrot, as to produce filenames that contain the date and size of the screenshot:
$ scrot ‘%Y-%m-%d_$wx$h.png’ -e ‘mv $f ~/Desktop/Pictures/’
(The command above will produce a file named 2010-11-28_2560×1024.png on the system and move that file to to a folder called Pictures.)
To get a screenshot and immediately open it in the GIMP, type:
$ scrot -q 85 -d 5 screenshot.png && gimp screenshot.png &
(The -q option sets the quality. The -d sets the delay. The && means that if the first command is true, then execute the second. The final & means to run the commands in the background so that you can still use that terminal for other commands.)
For more information about using scrot, read the man pages
$ man scrot
There are several ways to take a screenshot Linux in general. Which ways do you use?

