screen Cheatsheet - Terminal Session Manager Reference
The one command you must internalize is the detach/reattach pair — start with `screen -S name`, quit worry-free with Ctrl-a d, and come back later with `screen -r name`. Everything else (windows, splits, -x sharing) builds on that base; this table lays it out so your long jobs keep running after the network drops.
Session Management 8
screen -S nameCreate a named session
screen -lsList all sessions
screen -r nameReattach to a named session
screen -d nameDetach a session (without terminating)
screen -x nameAttach to an already-attached session (shared)
screen -X -S name quitTerminate a named session
Ctrl+a dDetach current session (keeps running in background)
screen -RD nameForce-detach remote and reattach (most common recovery)
Windows 8
Ctrl+a cCreate a new window
Ctrl+a n / pNext / previous window
Ctrl+a 0-9Switch to window by number
Ctrl+a ARename current window
Ctrl+a kClose current window (confirm)
Ctrl+a wList all windows
Ctrl+a "Interactively select a window
Ctrl+a Ctrl+aToggle between current and previous window
Split Screen 5
Ctrl+a SSplit horizontally (top/bottom)
Ctrl+a |Split vertically (left/right, screen 4.1+)
Ctrl+a TabCycle focus between splits
Ctrl+a XClose current split
Ctrl+a QClose all splits except current
Copy Mode 6
Ctrl+a [Enter copy mode; scroll and select text
SpaceStart selection (vi mode)
EnterCopy the selection
Ctrl+a ]Paste the last copied text
Ctrl+a EscExit copy mode
PageUp / PageDownScroll pages
Other 5
Ctrl+a ?Show all key bindings
Ctrl+a :Enter command mode
Ctrl+a HStart/stop logging
Ctrl+a xLock the session (password)
screen -dmS name cmdCreate a session in the background and run a command
Configuration (.screenrc) 6
startup_message offDisable the startup copyright banner
defscrollback 10000Set scrollback buffer to 10000 lines
term xterm-256colorSet terminal type for 256 colors
escape ^BbChange the prefix key to Ctrl+b (avoid conflicts)
screen -t editor 1 vimAuto-create a named window and run a command at start
caption always "%n %t"Always show window number and title at the bottom
Tips
- After SSH drops, the screen session survives; re-ssh and screen -r to resume — essential for remote work.
- Ctrl+a is the default prefix; change it in ~/.screenrc if it clashes with the terminal.
- screen is dated; for new projects prefer tmux (modern, plugin-supporting).
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Jul 21, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us