Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I often log via ssh to servers just to execute screen -r and look at my irssi irc session. Then I do Ctrl-AD and logout.

Is there a nice solution to wrap this into a script, so that I get to see the snapshot of my screen session in any format (graphical, or text)?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

You can get a "screenshot" of a screen session like this:

screen -p0 -X hardcopy hardcopy.txt

So this will take a hardcopy of whatever is in the first window (-p0) and put it in a file called hardcopy.txt (if you leave off the filename, it will use hardcopy.n where n starts at zero an increments each time.

The screenshot is on the remote machine, and I guess you want to view it. Perhaps something like:

ssh user@remote 'screen -p0 -X hardcopy hardcopy.txt; cat hardcopy.txt'

You could also log your irssi session, so the following would work:

ssh user@remote 'tail -50 /path/to/irssi/log'

If you want a screenshot that maintains colors, then that would depend a bit on the OS and desktop environment you sshing from.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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