Screenshot from the command line

The video card's frame buffer is considered a memory device, and thus you can read from it and write to it.

First:
sudo lshw -C video
Look for something like: logical name: /dev/fb0

sudo cp /dev/fb0 /home/$USER/Desktop/screencap.raw

You can then use ImageMagick or GIMP to edit that into a .png image file, or you can write it back to the frame buffer:
sudo cp /home/$USER/Desktop/screencap.raw /dev/fb0

What good is this? Well, say you have a headless remote server, and you want to see the console output. You can write that framebuffer over the network to your remote screen... almost as if it's not a headless server.

2 Likes