Is there a way to save what’s printed on the display with gnu screen

gnu-screensshterminal

I like to save everything I do on the command line, for example when I upgrade something and want to read back how the upgrade went etc..

Usually with Mac OSX and Terminal you can scroll back as much as you want, and save with Cmd-S. But when I'm on SSH using gnu screen, then I can't scroll back directly from terminal.

How can I save to disk everything that happens in a screen session? Maybe by default (every session automatically creates a file to disk…)

thanks!

Best Answer

There's a logging feature in screen. Start it when you start screen by doing screen -L (or from within screen). Or, also from within screen, you could press Ctrl-a : H.

If you want to have logging on as the default, add the following line to your ~/.screenrc file:

deflog on

You may want to set the filename using something like:

logfile /tmp/screenlog.%n
Related Question