Taking a screenshot from a virtual console

Every once in a while it happens to me that while working on one of the 6 virtual consoles an error message pops up that I want to look up on Internet. But copy-paste between a virtual console and the desktop doesn’t work, let alone being able to select some text on the console with your mouse.

As long as the text is on screen in the virtual console, it is relatively simple to grab it from an xterm in the desktop with the command below. Just replace the number `2` with whichever console number you want to grab:

$ sudo setterm -dump 2 -file /dev/stdout

Ubuntu 12.10 diablo tty2

diablo login: jhendrix
Password:
Last login: Sat Dec 15 09:26:02 CET 2012 on tty1
Welcome to Ubuntu 12.10 (GNU/Linux 3.5.0-17-generic x86_64)

* Documentation: https://help.ubuntu.com/

*** System restart required ***
No mail.
jhendrix@diablo:~$

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>