Quick tips for linux screenshots from the shell

As part of your workflow, you may need to take multiple screenshots quickly. There are several methods to do this within Linux, but the easiest and most efficient I’ve found is called import.

The manpage deatails all the options, but my most typical usage is simply:

import foo.png

(substituting the actual name I want to use for “foo”, of course)

This will cause your cursor to change to crosshairs. You can then position the crosshairs and draw a bounding box around the area you want to capture by pressing and holding the left mouse button. When you release the mouse button, the image is saved using the filename you provided.

This is the simplest and least-intrusive method I’ve found for visually documenting various things I’m doing on the command line, short of starting up script and saving every single thing I do, then going back later to pull out the relevant information.

Another handy tip: Once you’ve captured multiple images using import, you can quickly view them with the eog command. Running:

eog foo.png

will pop up a window containing the foo.png image (you can, of course, use regexes or wildcards to specify multiple image files simultaneously, and page through them this way). Now, you not only have a simple means of capturing workflow, but a quick and easy command-line method of checking the contents of already-captured images.

These two tools together can greatly enhance your work efficiency, allowing you to document in a relatively uninterrupted fashion while you continue working.

Alternatively, you can use feh for image viewing as well. They’re both full-featured; it’s down to personal preference.

feh foo.png
Bug BountyOSCP