Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

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.

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer

Is something like

 screen -Xx <screen_nr> hardcopy outfile.txt

what you are looking for?

Also take a look here.

share|improve this answer

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