Linux: Quick and Dirty Way to Take Screenshots

Random linux tip – if you don’t feel like dealing with the regular KDE or Gnome based applications or mechanisms for taking snapshots of your screen, there is a simpler and quicker way. You can do it directly from the console:

import -window root screenshot.png

Of course screenshot.png is the filename you want to assign to your screenshot. It’s quick and easy, and can be triggered at any time. You can even put it into a script, or run a cron job that will take a snapshot of your current workspace at certain time interval.

The command above takes a snapshot of the whole desktop. If you want to just grab a rectangular region, skip the window parameter:

import screenshot.png

You cursor should change into a cross, and allow you to draw a rectangle over the desired area and save it as the file name you specify.

Note that you will need to have the imagemagick package installed. On ubuntu do:

aptitude install imagemagick

Make sure you have universe enabled in your apt sources.

[tags]screenshots, screenshot, linux, ubuntu, import, imagemagick[/tags]

This entry was posted in sysadmin notes and tagged , , . Bookmark the permalink.



7 Responses to Linux: Quick and Dirty Way to Take Screenshots

  1. Craig Betts UNITED STATES Mozilla Firefox Solaris Terminalist says:

    FLIPPIN AWESOME!

    Solaris is now including the import command (/usr/sfw/bin/import) which works great!

    But . . . if you are working on antique systems like me, you might not have this command at your disposal. X11 provides a method of doing this:

    xwd -root -out screenshot.x

    However, this file is in Xbitmap format, but you can easily move it to another system and use imagemagik to convert it to the desired format:

    convert screenshot.x screenshot.jpg
    Reply  |  Quote
  2. Luke Maciak UNITED STATES Mozilla Firefox Ubuntu Linux says:

    Oh, nice! I’ll keep that in mind for the future. :)

    Reply  |  Quote
  3. jambarama UNITED STATES Mozilla Firefox Ubuntu Linux Terminalist says:

    Nice, I’ve looked all over for something like this. Terrific

    Reply  |  Quote
  4. Jake UNITED STATES Mozilla Firefox Linux says:

    Wow, this will be great for when I’m stuck on GNOME or the like. I’ve always just opened up the GIMP due to the lack of a ksnapshot like utility. Thanks!

    Reply  |  Quote
  5. jbj FRANCE Mozilla Firefox Windows says:

    Interesting article! One good thing to do should be mapping a key to this command. I should try tonight ;)
    Thanks for sharing.

    Reply  |  Quote
  6. JuEeHa FINLAND Mozilla Firefox Mac OS says:

    I actually know this because I sometimes forgot to add #/usr/bin/python to python scripts that used import and then ran it like ./python-script and got strange cursor and then it saved something like system*.ps. Later I actually have used only import to save screenshots.

    Reply  |  Quote
  7. cristian2006 ROMANIA Mozilla Firefox Ubuntu Linux says:

    another way is : Alt+SysRq.

    Reply  |  Quote

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>