4 Methods to Take Screenshot Capture in Ubuntu Linux

by Lakshmanan Ganapathy on August 6, 2012

Screenshot is an image taken by a computer to capture the visible items on the monitor or any other output devices. There are several ways of taking screenshots in Linux. In this article, we will cover few tools that are used for taking screenshots.

1. Use Print Screen

This is the most common method to take screenshots. Pressing the “Print Screen” button will take the screenshot of the “Entire Visible Screen”.

When we want to take a particular window, we can use “Alt+Print Screen”. Alt+PrintScreen will take only the particular window which is currently active.

2. Use gnome-screenshot

gnome-screenshot utility is part of the GNOME Desktop Environment, which can also be used to take screenshot. It also has a command line mode (gnome-screenshot)

Launch the screenshot tool as shown below.

Capture the Entire Screen:

From the UI, to take a screenshot with entire screen, select “Grab the whole desktop” and click “Take Screenshot”.

From the command-line, just type the command “gnome-screenshot” to do the same. The command will take a screenshot and provide a dialog to save it.

$ gnome-screenshot

Capture Only the Current Window:

From the UI, to take the screenshot of the current active window alone, select “Grab the Current Window” and click “Take Screenshot”.

From the command-line, use the -w option as follows to do the same.

$ gnome-screenshot -w

Take Screenshot After Some Delay:

From the UI, you can also set a delay before taking the screenshots. Set the “Grab after a delay” to the required number of seconds. This will be really helpful when we need to take screen shots of navigation.

From the command-line, use -d option to do the same. -d 2 is used for delaying the screenshot for 2 seconds. So within the 2 seconds, we can make the window which we want to take screenshot as active.

$ gnome-screenshot -w -d 2

Capture a Particular Area:

From the UI, if you want to take a particular rectangle area alone, then select “Grab a Particular area” and click “Take Screenshot”.

From the command-line, use the -a option to do the same. Once this command is entered, the mouse pointer will be changed, and you can drag and select which area to take screenshot.

$ gnome-screenshot -a

Take Screenshot Including or Excluding Window Border:

From the UI, you can also include or exclude the window border by selecting/deselecting “Include the Window Border” option.

From the command line, use -b/-B options respectively to do the same. This command will include the window border along with the screenshot.

$ gnome-screenshot -w -b

The following command will exclude the window border from the screenshot.

$ gnome-screenshot -w -B

3. Use ImageMagic’s Import Command

ImageMagick is an open source software suite for displaying, converting, and editing raster image files. It comes with various command line tools, and one of that is “import”. Now we will see, how we can use import to take screenshots. You can install it by using apt-get on debian/ubuntu as follows:

# apt-get install imagemagick

Capture Entire Screen using -window root option

Use the “-window root” option to take screenshot of the complete screen. The screenshot will be saved in the file name provided in the command line.

$ import -window root Pictures/Image5.png

ImageMagick supports more that 100 file types. You can use any one of them to store the output.

Capture a Particular Window/Area:

Type the following command, it will change the mouse pointer to “Cross” symbol. Select the window which you would like to take screenshot or click and drag to take screenshot of particular area.

$ import calc.png

Include the frame using -frame option:

You can also include the “frame” of the window using the -frame option.

$ import -frame Image6.png

Take Screenshot and Resize using -resize option:

You can also take screenshot and resize the screenshot using the -resize option. Pause option is used to make a delay before taking the screenshots.

$ import -window root -resize 640 -pause 4 Pictures/Image7.png

Please refer “man import” for more number of options supported by import command.

4. Use GIMP

You can also take screenshot from gimp. Launch gimp, and click “File->Create->Screenshot”. A new dialog window will open with options similar to gnome-screenshot.

Did we miss any of your favorite tools to capture screenshot? Leave a comment and let us know.


Linux Sysadmin Course Linux provides several powerful administrative tools and utilities which will help you to manage your systems effectively. If you don’t know what these tools are and how to use them, you could be spending lot of time trying to perform even the basic administrative tasks. The focus of this course is to help you understand system administration tools, which will help you to become an effective Linux system administrator.
Get the Linux Sysadmin Course Now!

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

{ 16 comments… read them below or add one }

1 Hook August 6, 2012 at 7:51 am

Use compiz Screen shots its easier and simple to use.

2 Pierre B. August 6, 2012 at 9:42 am

I usually use the imagemagic for remote connection, and ksnapshot for local computers.

Thx TGS for this reminder

3 Adnan Abbasi August 6, 2012 at 10:03 am

Shutter is also a very flexible tool for screen-captures.

4 Jalal Hajigholamali August 6, 2012 at 12:03 pm

Hi,
Thanks, very useful article…

5 Jesse August 6, 2012 at 12:05 pm

I really like Shutter because it has a good number of features w/o going overboard. Basic editing is really handy too.

6 Ethan August 6, 2012 at 4:49 pm

I just tried all the four methods. It is usefull in writing your own linux manues.

7 Simon August 6, 2012 at 5:07 pm

I also use shutter. It is useful because apart from clearly making the part of the screen you are capturing obvious, there are options to (a) store the images to particular directory and label them according to predefined schema, and (b) quickly augment the screen capture with annotations (arrows, circles and text). Makes collecting a sequence of screenshots without stopping your workflow, using simple keystrokes, extremely easy.

8 Milan August 7, 2012 at 12:58 am

I often use gimp for taking screenshots, then I can resize, crop etc.
but imagemagick is enough when I don’t need to alter screenshot.

9 Redneck August 8, 2012 at 2:00 am

i use scrot assigned to hotkey

10 bonez August 19, 2012 at 7:52 pm

You missed probably the most feature-rich screenshot tool – Shutter.

Install with

sudo apt-get install shutter

You can take screenshots of the whole desktop, or select an area to grab, you can then after the screenshot is taken draw on it or write text on it, export to various web services or to a folder. It is similar to SnagIt.

11 prajun nayak March 26, 2013 at 8:08 am

can you plz tell me how to take screenshot and save that screenshot automatically using unix command…I know the command for taking screenshot but how to save it automatically i don’t know….plz replay me…

12 Steven Pemberton April 17, 2013 at 3:52 am

SHIFT+print screen allows you to grab a portion of the screen.

13 dennis May 6, 2013 at 8:47 pm

the PrtSc button works just great and I don’t see why anyone should waste their time with any other tool if that one works for you.
the ctrl key modifier makes it save to the buffer for pasting.
1. by it’s self it prompts to save the whole desktop
2. alt + prtsc saves the current window
3. shift + prtsc lets you select an area

those 3 options with the ctrl key modifier pretty much gives you all the options you’d ever want.

14 Brandon August 27, 2013 at 5:54 pm

This is great thank you! I’m loving the gnome-screenshot command line method.

15 bas March 18, 2014 at 1:00 pm

I’ve got a problem; The quality of the screenshots is not good.
For example; When i take a screeenshot of openoffice writer, all the letters get a blue-ish edge around them.
How can i capture exactly what’s on the screen without loss ?

16 parrot June 3, 2014 at 12:55 pm

Scshoot is open-source cross-platform (Java) screen capture and recording tool: http://github.com/edartuz/scshoot

Besides of single-image capture, can record part of screen to animated PNG (APNG) or video.

Leave a Comment

Previous post:

Next post: