cheatsheet for GNU

GNU screen

Multi-user sessions

Suppose user1st and user2nd are the login names of the would-be collaborators on a single computer where the screen session

Commands for user1st who starts the screen session

screen
<hit a key to dismiss intro screen>
<ctrl-a> :multiuser on
<ctrl-a> :addacl user2nd

Note the space between ctrl-a keystroke and : is not meant to be typed; just here for readability (makes the : less likely to be overlooked)

Command for user2nd to join the same screen session

screen -rx user1st/

Scrollback

Start scrollback mode

<ctrl-a> <esc>

Note if you are already in scrollback mode when you do this sequence, you will receive the cryptic status message "Must be on a window layer" but it doesn’t hurt anything (you will still be in scrollback mode as intended).

Navigation

Can use arrow keys, page-up/page-down keys, vi-style navigation, and/or emacs-style navigation. This includes navigation by searching for literal strings, with both vi-style / (forwards) ? (backwards) and emacs-style <ctrl-s key-mappings supported.

End scrollback mode

<esc>

You will see status message "Copy mode aborted"

Logging

Start logging to a file /tmp/scroll-session.txt

<ctrl-a> :logfile /tmp/scroll-session.txt
<ctrl-a> :log on

You will see status "Creating logfile /tmp/scroll-session.txt" if the file doesn’t exist; status "Appending to logfile /tmp/scroll-session.txt" if it already does exist.

End logging

<ctrl-a> :log off

The resulting status message "Logfile /tmp/scroll-session.txt closed" will remind you where your logfile is located.