How to Take a Screenshot in Linux (Ubuntu)


SUBMITTED BY: Guest

DATE: May 9, 2013, 7:39 p.m.

FORMAT: Bash

SIZE: 4.1 kB

HITS: 1172

  1. How to Take a Screenshot in Ubuntu (GNOME)
  2. One way to take a screenshot in Ubuntu is to go to the main menu: Applications —> Accessories —> Take Screenshot.
  3. How to Take a Screenshot in Linux With the PrintScreen Button
  4. You can also take a screenshot of the entire screen by pushing the "Print Screen" (PrtSc) button on your keyboard. To get a screenshot of only the active window, use Alt-PrtSc. This is easier than using the GNOME "Take Screenshot" tool. You can also control this GNOME screenshot tool from the terminal as described in a newer Linux screenshot tutorial.
  5. To get more control over your screenshots, check out the other options below.
  6. How to Take a Screenshot in Linux With the Terminal (ImageMagick)
  7. My favorite way of taking screenshots is with ImageMagick in the terminal. If you need a delay before taking the screenshot (for example, to get a screenshot of a menu that would disappear if you took a screenshot with GNOME) ImageMagick is the best way.
  8. First, make sure you have ImageMagic installed: type import -version in the terminal. If ImageMagick is installed, you will see the ImageMagick version number. I don't think Ubuntu comes with ImageMagick. To install ImageMagick in Ubuntu (or any Debian-based distro), just type sudo apt-get install imagemagick.
  9. To take a screenshot in the terminal with ImageMagick, type the following line into a terminal and then click-and-drag the mouse over a section of the screen:
  10. import MyScreenshot.png
  11. GNOME will beep once when the screenshot begins, and once again when the screenshot is complete. Then type eog MyScreenshot.png in the terminal to view your screenshot. "eog" is the command to start Eye of GNOME.
  12. To capture the entire screen after a delay (so you can open some menus or whatever), type sleep 10; import -window root MyScreenshot2.png. The first part of that line, sleep 10; will give you a 10 second delay before the screenshot begins. The next part, import -window root, tells ImageMagick to import the "root" window that is, the entire screen. The last part MyScreenshot2.png is the name of your screenshot.
  13. Another example of taking a screenshot in Linux with the terminal
  14. The following command will wait for 15 seconds, take a screenshot, and then open the screenshot in the GIMP for editing:
  15. sleep 15; import -window root MyScreenshot3.png; gimp MyScreenshot3.png;
  16. You can also manipulate the screenshot with ImageMagick as you take it. For example, the following line will take a screenshot and resize the image to a width of 500 pixels:
  17. import -window root -resize 500 AnotherScreenshot.png
  18. For more information on how to take screenshots in the terminal with ImageMagick, type man imagemagick in the terminal. You can also type import -help to get a list of options for the import command.
  19. How to Take a Screenshot in Linux With the Terminal (scrot)
  20. Another way to take a screenshot from the terminal is with scrot. I learned about this at UbuntuForums.org.
  21. To install scrot (on Ubuntu) type:
  22. sudo aptitude install scrot
  23. To take a screenshot in Linux from the terminal with scrot type:
  24. scrot MyScreenshot.png
  25. To get a screenshot and immediately open it in the GIMP, type:
  26. scrot -q 85 -d 5 screenshot.png && gimp screenshot.png &
  27. 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.
  28. For more information about using scrot, read the man pages by typing the following in the terminal:
  29. man scrot
  30. How to Take a Screenshot in Linux With the Terminal (gnome-panel-screenshot)
  31. As described in my newer Linux screenshot tutorial, you can also take a screenshot from the Linux terminal in GNOME with the following command:
  32. gnome-panel-screenshot
  33. You can also add a delay:
  34. gnome-panel-screenshot --delay 5

comments powered by Disqus