I've started a job in a terminal that will print some data to the screen that I need. I know I should have used screen or told the terminal to log to a script but I did not. Also, I do not have the option to stop and restart the process. Still, I want to be able to SSH into the box and grab the text from the terminal display once the job is done. Is this possible?

(Linux 3.2.0-55-generic #85-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux)

  • Once the computer has sent the text to the terminal, the only thing that "remembers" the text is the terminal program itself. Your best bet is probably to use a screenshot utility to get an image of the terminal window.
    – Kenster
    Aug 9 '14 at 19:20
  • @kenster is that something i can do remotely?
    – 4myle
    Aug 10 '14 at 16:38
  • What operating system is hosting the display where this terminal program is displaying? Is it putty on windows? some X-based program on linux? Something else?
    – Kenster
    Aug 10 '14 at 16:41
  • System info included in the question in parentheses. Using default terminal in Ubuntu.
    – 4myle
    Aug 11 '14 at 13:03

You can do this using virtual consoles. The /dev/vcs* and /dev/vcsa* devices corresponds to the /dev/tty* devices (the virtual terminals). /dev/tty1 should have a matching /dev/vcs1 and vcsa1.

As root, you can cat these devices (e.g. cat /dev/vcs1), and see what's on the corresponding tty. Note that the output does not contain newline characters, so some processing may be required, for example:

fold -w 80 /dev/vcs1 > screendump.txt

See man vcsa

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.