📖 Guide
Screen — Complete Reference
GNU Screen terminal multiplexer — session management, window splits, copy mode, key bindings, and common workflows.
50 commands across 7 categories
Session Management
| Command | Description |
|---|---|
screen | Start a new screen session |
screen -S mysession | Start a named session |
screen -ls | List all screen sessions |
screen -r mysession | Reattach to a named session |
screen -d mysession | Detach a session remotely |
screen -dr mysession | Detach and reattach a session |
screen -x mysession | Attach to an already-attached session (multi-display) |
Ctrl+a d | Detach from current session |
Window Management
| Command | Description |
|---|---|
Ctrl+a c | Create a new window |
Ctrl+a n | Switch to next window |
Ctrl+a p | Switch to previous window |
Ctrl+a A | Rename current window |
Ctrl+a w | List all windows |
Ctrl+a 0-9 | Switch to window by number |
Ctrl+a " | Show interactive window list |
Ctrl+a k | Kill current window |
Split Regions
| Command | Description |
|---|---|
Ctrl+a S | Split horizontally |
Ctrl+a | | Split vertically |
Ctrl+a Tab | Switch to next region |
Ctrl+a X | Close current region |
Ctrl+a Q | Close all regions except current |
Ctrl+a :resize 20 | Resize current region to 20 lines |
Copy Mode
| Command | Description |
|---|---|
Ctrl+a [ | Enter copy/scrollback mode |
Space | Start/end selection (in copy mode) |
Enter | Copy selection and exit copy mode |
Ctrl+a ] | Paste copied text |
h/j/k/l | Navigate in copy mode (vi keys) |
Ctrl+u / Ctrl+d | Scroll half-page up/down in copy mode |
/search | Search forward in copy mode |
?search | Search backward in copy mode |
Configuration
| Command | Description |
|---|---|
defscrollback 10000 | Set scrollback buffer size in .screenrc |
startup_message off | Disable splash screen in .screenrc |
shell /bin/zsh | Set default shell in .screenrc |
hardstatus alwayslastline '%H | %w' | Configure status bar in .screenrc |
caption always '%n %t' | Show window caption in .screenrc |
bind j focus down | Custom key binding in .screenrc |
Key Bindings
| Command | Description |
|---|---|
Ctrl+a ? | Show all key bindings |
Ctrl+a : | Enter command mode |
Ctrl+a a | Send literal Ctrl+a to the terminal |
Ctrl+a H | Toggle logging of current window to file |
Ctrl+a M | Monitor window for activity |
Ctrl+a _ | Monitor window for silence |
Ctrl+a Ctrl+l | Redraw/refresh the screen |
Common Workflows
| Command | Description |
|---|---|
screen -dmS bg-job bash -c 'long-task.sh' | Start a detached session running a command |
screen -S work -X stuff 'ls\n' | Send a command to a named session |
screen -wipe | Remove dead sessions from the list |
Ctrl+a :sessionname newname | Rename the current session |
screen -S session -p 0 -X quit | Kill a specific session by name |
Ctrl+a L | Toggle login mode for current window |
screen -r -d | Force detach and reattach (steal session) |
📖 Free, searchable command reference. Bookmark this page for quick access.