FAQ: How to scrollback in GNU SCREEN?

Q: I was compiling kernel using GNU Screen utility but something happened during the compilation and I want to see full error’s output but I can’t just scrollback using Ctrl+PageUp. How to scrollback in GNU Screen?

A: In GNU Screen press Ctrl + a + [ to enter Copy Mode, then scroll up/down using keys j or k. Below are some other navigation keys:

h - Move the cursor left by one character
j - Move the cursor down by one line
k - Move the cursor up by one line
l - Move the cursor right by one character
0 - Move to the beginning of the current line
$ - Move to the end of the current line.
G - Moves to the specified line
(defaults to the end of the buffer).
C-u - Scrolls a half page up.
C-b - Scrolls a full page up.
C-d - Scrolls a half page down.
C-f - Scrolls the full page down.

By the way, in order to define scrollback buffer size start screen with the following key (5000 lines in this example):

screen -h 5000

Quick info about GNU Screen utility: it is Unix tool that allows to run multiple applications in several “virtual” windows. It is very useful when you need, let’s say, to see hardware resources consumption caused by started application in different console etc. GNU screen is also good option to run applications remotely via ssh: just run application in screen and log off until it’s finished, then just “pick up” screen session and see how the application’s output.

Update: You can use activate copy mode of GNU Screen also by Ctrl + Esc that might be more useful than Ctrl + a + [ shortcut (thanks to Yu-Jie Lin for this tip).

14 Comments

Copy mode also can be activated with Ctrl+a, then Escape. I usually stay my left hand on escape after activated, and use right hand to press Page Up/Down. After I read I want to read, I then use the hand on the Escape key to press the key to leave copy mode.

A lot of of whatever you say is astonishingly appropriate and it makes me wonder why I hadn't looked at this in this light before. Your piece really did turn the light on for me personally as far as this specific issue goes. Nevertheless at this time there is actually one particular position I am not too cozy with and whilst I attempt to reconcile that with the central idea of the point, permit me see just what all the rest of your visitors have to say.Well done.

Artem is systems engineer for more than 7 years and holds broad experience in Linux, Unix, Cisco systems administration. Feel free to get in touch with Artem Nosulchik via Google Plus, Twitter or Facebook.

Most Read This Week

LinuxScrew Recommends

Who’s behind LinuxScew?

My name is Artem Nosulchik, I'm part time blogger and full-time Linux sysadmin. In 2007 I started LinuxScrew to share my personal notes on anything related to Linux and Open Source on the whole and found this pretty interesting.