GNU screen cheatsheet

Quick reference to GNU screen essential bindings

2 minute read

GNU screen is a terminal multiplexer that allows for different virtual windows and panes running different processes within the same terminal session, being it local or remote. This post contains a quick reference to the most used default key bindings of GNU screen. In contrast to other terminal multiplexers like tmux, GNU screen is probably already installed in your server of choice.

Commands

CommandAction
screen -S <session-name>create new session with name
screen -r or screen -xattach to most recent session
screen -r <session-name>attach to named session
screen -lslist running sessions

Basics

KeysAction
ctrl + aescape key (used to access all other key bindings)
ctrl + a ddetach and go back to original terminal session
ctrl + a D Ddetach and log out
ctrl + a </kbd>exit all programs in screen
ctrl + a ctrl + \force exit (not recommended)
ctrl + a :quitclose session and quit screen
ctrl + a ?help

Window management

KeysAction
ctrl + a ccreate new window
ctrl + a Arename current window
ctrl + a "show window list and choose window
ctrl + a wdisplay window bar
ctrl + a 1,2,…switch to window number
ctrl + a nmove to next window
ctrl + a pmove to previous window

Splits

KeysAction
ctrl + a Shorizontal split
ctrl + a V or |vertical split
ctrl + a tabjump to next region
ctrl + a Xclose current region
ctrl + a Qclose all regions but current

Clibpoard

KeysAction
ctrl + a [enter copy mode
spacetoggle selection and copy
ctrl + a ]paste

Configuration

Finally, I just want to share my .screenrc configuration. It starts with 5 windows by default and adds a window bar at the bottom with the host, the window list and the time so that you never miss your appointments. Find it here.

GNU screen with the configuration above

Website design by myself. See the privacy policy.
All content on this site is licensed under CC-BY-NC-SA 4.0.