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
Command
Action
screen -S <session-name>
create new session with name
screen -r or screen -x
attach to most recent session
screen -r <session-name>
attach to named session
screen -ls
list running sessions
Basics
Keys
Action
ctrl + a
escape key (used to access all other key bindings)
ctrl + ad
detach and go back to original terminal session
ctrl + aDD
detach and log out
ctrl + a\
exit all programs in screen
ctrl + actrl + \
force exit (not recommended)
ctrl + a:quit
close session and quit screen
ctrl + a?
help
Window management
Keys
Action
ctrl + ac
create new window
ctrl + aA
rename current window
ctrl + a"
show window list and choose window
ctrl + aw
display window bar
ctrl + a1,2,…
switch to window number
ctrl + an
move to next window
ctrl + ap
move to previous window
Close all processes (incl. shell)
close window
ctrl + ak
force close window
Splits
Keys
Action
ctrl + aS
horizontal split
ctrl + aV or |
vertical split
ctrl + atab
jump to next region
ctrl + aX
close current region
ctrl + aQ
close all regions but current
Clibpoard
Keys
Action
ctrl + a[
enter copy mode
space
toggle 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.