In this tip we will see how to take screenshots of any selected window using the command line, no need to use third-party software. The tutorial is workable for Ubuntu as well as other Debian-based distributions.

First, install the "imagemagick" package with this command:

sudo apt-get install imagemagick

To take a screenshot, use now this command:

import -window `xwininfo | awk '/Window id/{print $4; exit}'` `uuidgen`.png

Use now your mouse cursor to select any window you want to take a screenshot of. The image will be created in the current terminal location having the .png extension.

That's it!

Post a Comment