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.

When I use screen I can only see the current data on the terminal (commands, messages, etc.).

Is there a way, apart from printing anything I want to a file, to see the previous messages (the same way a normal terminal emulator would)?

share|improve this question

1 Answer 1

up vote 8 down vote accepted

Hitting Ctrl+A then Esc should get you into a special mode to look through the scroll-back buffer much like hitting Esc in vim gets you into a mode where you can navigate the file rather than inserting into it.

If your scroll-back buffer doesn't have enough lines in it to be useful you can change this in your ~/.screenrc file:

defscrollback 10000

Once in the scroolback buffer, you can use common key bindings like J/K/H/L, PgUp/PgDown, G/Shift+G, ^/$ and arrows to navigate. You can use Space to set a mark. Setting a second mark will copy everything between the two marks to the screen clipboard which you can then paste into any window using Ctrl+A ].

You can also search and do other things with the buffer. See the screen users manual for more.

share|improve this answer
    
I am able to copy from screen buffer, but how do I paste it to gedit? –  abc Aug 26 '11 at 5:37
    
@abc: You would need to tranfer it from the screen clipboard to the X clipboard. Try using shell in screen and running: cat - | xclip and then Ctrl+A ]. –  Caleb Aug 26 '11 at 9:03
    
May be I am doing something wrong. cat - | xclip just hangs. I copied characters from screen buffer and then tried to paste them to a text editor and that did not work. Can you elaborate please? –  abc Aug 26 '11 at 22:33

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.