This is an old revision of the document!
screen
Notes on the GNU screen console multiplexer.
screen is a program that allows multiple terminals/consoles to be maintained on a host indefinitely independent of a terminal client. This allows remote terminal sessions to be persisted across network connections.
- sessions
- create session: screen -S <session id>
- list sessions: screen -ls
- detach: Ctrl-a d
- attach: screen -r <session id>
- attach to non-detached session (session sharing): screen -x <session id>
- attach, detaching first if necessary: screen -dr <session id>
- quit: Ctrl-a Ctrl-\
- quit: screen -S <session id> -X quit
- quit: Ctrl-a :quit
- windows
- create: Ctrl-a c
- kill: Ctrl-a k
- name window title: Ctrl-a A
- open window list to switch to another window:
Ctrl-a “
- regions
- vertical split: Ctrl-a |
- split: Ctrl-a S
- remove: Ctrl-a X
- move to region: Ctrl-a tab
- scrollback/scroll in a region:
C-a [
orC-a ESC
to enter copy mode then arrow keys.
Common Commands
- create session:
screen -S <session id>
- attach to a session:
screen -r <session id>
- In some cases it is necessary to detach from a session before re-attaching to it:
screen -dr <session id>
- open window list to switch to another window:
Ctrl-a ”
- create window:
Ctrl-a c
- name window title:
Ctrl-a A
- kill window:
Ctrl-a k
Nested Sessions
- Use key sequence
Ctrl+a a
to send commands to the nested session.