5

I am running a detached screen session, and running a command into it with screen -X, like so:

screen -S $SESSION -X <command>

This works fine, though I would like to be able to catch the output of the command without entering the screen. Is there some way to, from the command line, dump the history?

As a workaround, I tried to turn on the log for the session by doing

screen -L -S $SESSION -X <command>

but it does not seem to create a log file.

So, in summary, is it possible to dump the screen history for a running detached screen session or is it possible to turn on and off logging for a running detached session?

1

1 Answer 1

3

To start a screen with logging enabled, use

screen -L <command>

To enable logging on an existing screen

screen -X log

you might want to specify which screen if you have multiple running using -S

The log will contain everything the screen sends to stdout from when logging was enabled. You may want to remove screenlog.X and re-enable logging to get the most recent output.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .