crpto
crpto

Reputation: 13

Show full history of screen

I have a little script (which prints information into the shell) on my VPS which I run with screen. Everytime I reopen the screen session with screen -r <name>, I only see few lines. However, I would like to see the full history (or at least a big portion of it), not just few lines. Could you please tell me how to do that?

Upvotes: 1

Views: 2308

Answers (2)

Armali
Armali

Reputation: 19395

It seems you want to enter copy/scrollback mode, which is done by typing Ctrl-A Esc (with default key binding) - see man screen.

Upvotes: 2

John b
John b

Reputation: 1398

How are you writing to the screen?

Do you start screen and then run the print script or is another process writing to your screen session? (I will assume the first case)

Probably you want the tee command

myPrintScript.sh | tee -a myLog.txt &

This will print the data from "myPrintScript" and save a file call log.txt. When ever you need to look back at the print info use

cat myLog.txt | less

You should be able to see all the log data you want

Let me know if understand your question.

As a bounce you might use ts (form moreutils) to get a timestamp

myScript | ts | tee -a myLog.txt&

Upvotes: 0

Related Questions