How to take a screenshot in console (without X)

screenshottty

My netbook runs on Debian Linux without X.org. I sometimes need to make a screenshot of the output of scripts. I tried to use a framebuffer device for this purpose:

# cat /dev/fb0 > screenshot.raw

But the problem is that this .raw file is not a graphic format since it cannot even be opened with GIMP. How it's possible to convert it to .png file, for example?

Best Answer

The format of the raw file you capture is going to depend on the bit depth and resolution.

There are a number of tools out there to do this. Debian has the fbcat package. You may need to sudo apt-get install fbcat to install it.

fbcat will grab the frame buffer in ppm format, so you can then use ppmtojpeg or similar to convert it to the format you want.

There's also a fbgrab wrapper which will save in PNG format.

Related Question