This question already has an answer here:

I am working on a collectd plugin to monitor a program I have running in a detached screen session. This program constantly updates the terminal with its status by replacing its old status (similar to programs like top, etc).

I would like to be able to grab what it is currently "showing" and parse it to get the current status of the program. I know there is a way to send text to a screen, but is there a way to grab it? Alternatively, is there another program/approach to accomplish what I am looking for?

marked as duplicate by Gilles, vonbrand, rahmu, jasonwryan, Renan Apr 13 '13 at 1:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


That'd be the hardcopy command.

screen -x yoursession -X hardcopy /path/to/your/file

Would cap what the terminal is currently showing, without backlog, to the given file.


Is something like

 screen -Xx <screen_nr> hardcopy outfile.txt

what you are looking for?

Also take a look here.

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