Cheatsheet: GNU Screen
Last updated 2026-09-19
Basic Commands
Start a new screen session
Start a new session with a specific name
List running screen sessions
Attach to a detached session
Detach from a session
Session management in depth
Force-detach a session that's stuck attached elsewhere, then reattach it here.
Force a full detach (kills the other attachment outright) if -d -r doesn't respond.
Attach to a session while leaving it attached elsewhere too, for shared viewing/control.
Kill a named session from outside it, without attaching first.
Terminate a session from inside it by exiting every window, or with the :quit command.
Scrollback and copy mode
Enter copy mode to scroll back through a window's output history.
Once in copy mode, use arrow keys or Page Up/Page Down to scroll; press Esc or q to exit.
Select and copy text: mark the start, move to the end, mark it again, then paste elsewhere.
Increase the scrollback buffer size (default is small) in ~/.screenrc.
Managing Windows
Create a new window
Switch to the next window
Switch to the previous window
Close the current window
Split the current window vertically
Miscellaneous
Reattach a session with multiple users
Send a command to a specific window
Lock the screen session
Installation
Install with yum (CentOS/RHEL)
Install with apt (Debian/Ubuntu)
Install with brew (Mac)