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.
Related Posts:


September 26th, 2007 at 2:28 pm (6315) [Quote]
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.xHowever, 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:
September 26th, 2007 at 3:00 pm (6316) [Quote]
Oh, nice! I’ll keep that in mind for the future.
Posted usingSeptember 26th, 2007 at 6:33 pm (6317) [Quote]
Nice, I’ve looked all over for something like this. Terrific
Posted usingSeptember 26th, 2007 at 9:55 pm (6318) [Quote]
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!
Posted usingOctober 3rd, 2007 at 5:53 am (6392) [Quote]
Interesting article! One good thing to do should be mapping a key to this command. I should try tonight
Posted usingThanks for sharing.