Screen multiplexes a physical terminal between several processes (typically interactive shells). Each virtual terminal emulates a DEC VT100 and provides scrollback history, copy/paste, and detach/reattach capabilities.
| Use Case | Command / Keystroke | Description |
|---|---|---|
| Start a new session | screen | Create a window with a shell |
| Create a new window | C-a c | Start a new shell window |
| Detach session | C-a d | Detach and leave processes running |
| Reattach session | screen -r | Reattach to a detached session |
| List windows | C-a w | Show all windows with numbers/titles |
| Select window by number | C-a 0β¦9 | Jump to window n |
| Next / Previous window | C-a n / C-a p | Cycle through windows |
| Kill current window | C-a k | Destroy window (and its process) |
| Split region horizontally | C-a S | Split the display |
| Split region vertically | C-a | | Vertical split |
| Enter copy/scrollback mode | C-a [ | Copy text from scrollback |
| Paste buffer | C-a ] | Paste copied text |
| Lock screen | C-a x | Lock terminal (requires lock program) |
| Quit screen | C-a \ | Kill all windows and exit |
| Show help (key bindings) | C-a ? | Display all bound commands |
Screen creates a single window with a shell (or a specified command) and gets out of your way. At any time you can create new windows, switch between them, kill windows, view a list, turn on logging, copy/paste text, and detach the whole session. All windows run independently; processes continue even when their window is not visible or when the session is detached.
Everything you type goes to the current window except the command prefix (default C-a). Commands are two strokes: one to initiate, one to act. The command character and all key bindings are fully customisable.
New windows are created with C-a c. You can also launch new windows from a shell inside an existing window: screen emacs prog.c.
If /run/utmp is writable, screen adds entries for each window (useful for talk, shutdown, etc.).
Commandβline options (abbreviated):
-a β include all capabilities in windowβs termcap (even if redraw needed).-A β adapt all window sizes to the display size on attach.-c file β use file instead of $HOME/.screenrc.-d / -D [pid.sessionname] β detach a session running elsewhere. Combine with -r/-R for powerful reattach.-e xy β set command character to x and literal command character to y. Default ^Aa.-f / -fn / -fa β flow control: on, off, auto.-h num β set scrollback history lines.-i β make interrupt key (C-c) interrupt display immediately when flow control is on (discouraged).-l / -ln β turn login mode on/off (utmp recording).-ls / -list [match] β list session IDs and statuses.-L β turn on automatic output logging for windows.-Logfile file β set logfile name (default screenlog.0).-m β ignore $STY; always create a new session.-O β use a more optimal output mode (affects autoβmargin terminals without LP).-p name_or_number β preselect a window. Special: - (blank), = (windowlist), + (new).-q β suppress error messages; set exit values for -ls / -r.-Q β query commands from a remote session (e.g., screen -Q windows).-r [pid.sessionname] β resume a detached session.-R β reattach if unambiguous, else list sessions.-RR β resume mostβrecently created detached session, or start new.-s program β default shell program.-S sessionname β set a name for the session.-t name β set title for default shell or specified program.-T term β set $TERM value.-U β run in UTFβ8 mode.-v β print version.-wipe [match] β list sessions and remove destroyed ones.-x β attach to a session already attached elsewhere (multiβdisplay mode).-X β send a command to a running session..screenrc)Default settings can be modified via a personal .screenrc file and/or /etc/screenrc. Environment variables $SYSSCREENRC, $SCREENRC, and $HOME/.screenrc are searched. Option -c overrides.
Commands are one per line; empty lines ignored. Arguments separated by tabs/spaces, may be quoted. # starts a comment (except in quotes). Variable substitution: $VAR or ${VAR}.
source file β read and execute commands from a file. Nested up to 10 levels. Note that termcap/terminfo commands only work at startup/reattach time.colon (C-a :) β enter .screenrc commands interactively. Set commands no longer require set; use defβ¦ for defaults.A command may be bound to a key, used in screenrc, or typed at the colon prompt. All commands can be bound to keys (since v3.3).
| Keystroke | Command | Description |
|---|---|---|
C-a ' | select | Prompt for window identifier and switch |
C-a " | windowlist -b | Present list of all windows |
C-a 0β¦9, - | select | Switch to window number or blank |
C-a Tab | focus | Switch focus to next region |
C-a C-a | other | Toggle to previously displayed window |
C-a a | meta | Send the command character (C-a) to window |
C-a A | title | Enter a title for current window |
C-a b, C-b | break | Send a break to the tty |
C-a B | pow_break | Close and reopen tty line |
C-a c, C-c | screen | Create new window with shell |
C-a C | clear | Clear screen |
C-a d, C-d | detach | Detach from terminal |
C-a D D | pow_detach | Detach and logout |
C-a f, C-f | flow | Cycle flow control on/off/auto |
C-a F | fit | Resize window to region size |
C-a C-g | vbell | Toggle visual bell |
C-a h | hardcopy | Write hardcopy to file |
C-a H | log | Toggle logging |
C-a i, C-i | info | Show info about current window |
C-a k, C-k | kill | Destroy current window |
C-a l, C-l | redisplay | Refresh current window |
C-a L | login | Toggle windowβs login state |
C-a m, C-m | lastmsg | Repeat last message |
C-a M | monitor | Toggle activity monitoring |
C-a SPC, n, C-n | next | Switch to next window |
C-a N | number | Show current window number / title |
C-a p, C-p, C-h, Backspace | prev | Switch to previous window |
C-a q, C-q | xon | Send ^Q (XON) to current window |
C-a Q | only | Delete all regions but current |
C-a r, C-r | wrap | Toggle lineβwrap |
C-a s, C-s | xoff | Send ^S (XOFF) |
C-a S | split | Split region horizontally |
C-a t, C-t | time | Show load average and time |
C-a v | version | Display version |
C-a C-v | digraph | Enter digraph sequence |
C-a w, C-w | windows | List active windows |
C-a W | width | Toggle between 80 and 132 columns |
C-a x, C-x | lockscreen | Lock terminal |
C-a X | remove | Kill current region |
C-a z, C-z | suspend | Suspend screen |
C-a Z | reset | Reset virtual terminal to powerβon |
C-a . | dumptermcap | Write .termcap file |
C-a ? | help | Show key bindings |
C-a \ | quit | Kill all windows and exit |
C-a : | colon | Enter command line |
C-a [, C-[, ESC | copy | Enter copy/scrollback mode |
C-a ], C-] | paste . | Write paste buffer to stdin of current window |
C-a {, C-a } | history | Copy/paste previous (command) line |
C-a > | writebuf | Write paste buffer to screenβexchange file |
C-a < | readbuf | Read screenβexchange file into paste buffer |
C-a = | removebuf | Delete screenβexchange file |
C-a _ | silence | Monitor window for inactivity |
C-a | | split -v | Split region vertically |
C-a , | license | Show copyright page |
C-a * | displays | Show listing of attached displays |
All commands (abridged):
acladd usernames β allow other users in this session.aclchg usernames permbits list β change a userβs permissions.acldel username β disallow other user.aclgrp usrname [groupname] β inherit permissions from group leader.aclumask [users]+/-bits ... β predefine access to new windows.activity message β set activity notification message.addacl usernames β synonym to acladd.allpartial state β set all windows to partial refresh.altscreen state β enable βalternate screenβ support.at [ident][#|*|%] command [args] β execute command at other displays/windows.attrcolor attrib [attribute/color-modifier] β map attributes to colors.autodetach state β automatically detach session on SIGHUP.autonuke state β enable clear screen to discard unwritten output.backtick id lifespan autorefresh command [args] β define a command for the backtick string escape.bce [state] β change backgroundβcolorβerase.bell_msg [message] β set bell notification message.bind [-c class] key [command [args]] β bind a command to a key.bindkey [opts] [string [cmd args]] β bind a string to a series of keystrokes.blanker β activate screen blanker.blankerprg β define a blanker program.break [duration] β send break signal to current window.breaktype [TCSENDBREAK | TCSBRK | TIOCSBRK] β specify how to generate breaks.bufferfile [exchange-file] β select screenβexchange file.bumpleft β swap window with previous one on window list.bumpright β swap window with next one on window list.c1 [state] β change c1 code processing.caption mode [string] β change caption mode and string.chacl usernames permbits list β synonym to aclchg.charset set β change character set slot designation.chdir [directory] β change current directory for future windows.cjkwidth β treat ambiguous width characters as full/half width.clear β clear window screen.collapse β reorder window list, removing number gaps.colon β enter a screen command.command [-c class] β simulate the screen escape key.compacthist [state] β select compaction of trailing empty lines.console [state] β grab or ungrab console output.copy β enter copy mode.copy_reg [key] β (removed) use paste instead.crlf state β select line break behavior for copying.debug state β suppress/allow debugging output.chdir [directory] β change default directory for new windows. If omitted, $HOME.
screen [opts] [n] [cmd [args] | //group] β create a new window. Options: -f flow, -fn, -fa, -t title, -l/-ln login, -T term, -a, -h num, -M (monitoring), -L (logging). If //group, creates a container window.
setenv var string β set environment variable for new windows. unsetenv var β unset it.
shell command / defshell command β command to create new shell. Overrides $SHELL. shelltitle title β default title for shells.
term term β set $TERM for new windows (discouraged for nonβdefault; use screen -T term instead).
/dev/ttya). Optional commaβseparated flags: baud rate, cs8/cs7, ixon/-ixon, ixoff/-ixoff, istrip/-istrip.//telnet host [port]. Flags shown in info: BINARY, ECHO, SGA, TTYPE, NAWS, LFLOW.Create a container with screen //group. Use group [grouptitle] to show/move windows between groups. Combines well with layouts.
next (C-a SPC, n, C-n) β cycle forward. prev (C-a p, C-p, C-h, Backspace) β cycle backward.
other (C-a C-a) β toggle between current and last window.
select [n|-|.] (C-a N, C-a ') β switch to window number, blank (-), or current (.).
windowlist [-b] [-m] [-g] (C-a ") β interactive list with navigation (j/k, search, etc.). Custom format via string / title.
detach (C-a d) β disconnect and put session in background. autodetach state (default on) β autoβdetach on hangup. password [crypted_pw] β set reattach password.
pow_detach (C-a D D) β detach and SIGHUP parent process. pow_detach_msg [message] β custom message.
lockscreen (C-a x) β run a lock program. $LOCKPRG or builtin.
(requires compileβtime support) multiuser state β toggle multiβuser mode. Use acladd, aclchg, acldel, aclgrp, displays, umask, wall, writelock, su.
sessionname [name] β rename session (caution: old name stays in existing shells). Prefer -S option.
suspend (C-a z) β put screen in background.
quit (C-a \) β kill all windows and exit.
split [-v] (C-a S, C-a |) β create a new region. Use focus to toggle.
focus [ next|prev|up|down|left|right|top|bottom ] (C-a Tab) β move input focus.
only (C-a Q) β kill all regions but current one.
remove (C-a X) β kill current region.
resize [opts] [ [+|-]N[%] | = | max | min | _ | 0 ] β grow/shrink region.
caption always|splitonly [string] β control caption display and content (default %3n %t).
fit (C-a F) β resize window to region size.
focusminsize [ (width|max|_) (height|max|_) ] β enforce minimum region size.
Subcommands: layout new [title], remove, next, prev, select, show, title, number, attach, save, autosave, dump.
title [windowtitle] (C-a A) β set window name. Dynamic titles: set name as search|name and embed null title escape in prompt.
console [state] β grab/release console output (needs TIOCCONS).
kill (C-a k) β destroy window. Caution: rebind if you use Emacs.
login [state] (C-a L) β toggle utmp entry. deflogin state sets default.
defmode mode β octal pty permissions (default 0622 logged, 0600 others).
monitor [state] (C-a M) β watch for activity. silence [state|sec] (C-a _) β watch for silence. activity message, bell_msg message customise notifications.
windows [string] (C-a w) β list all windows with status markers: * current, - previous, $ logged in, ! bell, @ activity, (L) logging, &/&& shared, Z zombie. Custom format via string escapes.
hstatus status β set current windowβs hardstatus line. defhstatus [status] β default for new windows.
Full VT100 emulation plus many ANSI/ISO sequences. (See manual for complete table.)
Default key mappings for cursor keys, function keys, keypad, etc. (table in original).
digraph [preset [unicode-value]] (C-a C-v) β enter digraph sequences (e.g., a" β Γ€). Builtβin table for Latinβ1 etc.
vbell [state] (C-a C-g) β toggle visual bell. vbell_msg [message], vbellwait sec.
clear (C-a C) β clear and save to scrollback.
info (C-a i) β show cursor position, window size, scrollback, flow, wrap, mode flags, charsets, etc. dinfo β show terminal capabilities.
redisplay (C-a l) β full redraw. partial state β partial refresh on switch. allpartial state β global override. altscreen state β alternate screen support.
wrap [on|off] (C-a r) β toggle lineβwrap. defwrap state.
reset (C-a Z) β reset terminal to powerβon values.
width [-w|-d] [cols [lines]] (C-a W) β toggle 80/132 columns. height [-w|-d] [lines [cols]] β set height.
c1 state, gr state, bce state, encoding enc [denc], charset set, utf8 [state], and their def⦠counterparts. cjkwidth [state].
copy (C-a [) β enter copy/scrollback mode with viβlike keys. Features: mark, repeat, search (/, ?, C-s, C-r), yank, append, rectangular blocks. ignorecase [on|off].
paste [registers [destination]] (C-a ]) β paste from registers/paste buffer. stuff [string] β insert string directly.
register [-e encoding] key string, readreg [-e encoding] [register [filename]], process [key].
bufferfile [exchange-file], readbuf (C-a <), writebuf (C-a >), removebuf (C-a =).
history (C-a {, C-a }}) β recall command lines based on first letter.
exec [[fdpat] newcommand [args ...]] β run a filter in the current window. Abbreviations: ! for exec, | for !..|. Examples: /bin/sh, |less, !:sed -n s/.*Error.*/\007/p.
bind [-c class] key [command [args]] β define or remove a binding. bindkey for input translation tables. escape xy / defescape xy β set command character. meta (C-a a) β send literal command char. command [-c class] β simulate escape key. help (C-a ?) β show bindings.
flow [fstate] (C-a f) β on/off/auto. defflow for default. xon (C-a q) / xoff (C-a s) β send ^Q/^S directly. interrupt option flushes output on interrupt.
Windows get screen termcap; can be tweaked. dumptermcap writes a .termcap file. Commands: termcap, terminfo, termcapinfo. Special capabilities: LP, Z0/Z1, WS, NF, G0, etc. Autonuke (autonuke), output buffer limit (obuflimit), character translation (XC).
Nonβstatus terminals: last line used. ANSI Privacy Message can display text. hardstatus configures hardware status line. lastmsg (C-a m) repeats last message. msgminwait, msgwait control timing.
hardcopy [-h] [file] (C-a h) β dump screen image. log [state] (C-a H) β log window output to screenlog.N. logfile, logtstamp, hardcopydir.
echo [-n] message, sleep num, startup_message state β control .screenrc startup.
at, break, pow_break, breaktype, defbreaktype, bumpleft, bumpright, collapse, debug, license, nethack, nonblock, defnonblock, number, time, verbose, version, zombie, zombie_timeout, printcmd, rendition, sorendition, attrcolor, setsid, eval, maxwin, backtick, idle, blanker, blankerprg, zmodem, mousetrack.
Format strings for captions, hardstatus, windowlist, etc. Escapes: %n (window number), %t (title), %f (flags), %w (window list), %h (hardstatus), %c/%C (time), %H (host), %l (load), %S (session), %{β¦} (attributes/colors), %?β¦%:β¦%? (conditional), %=, %> (truncation/padding), %` (backtick output).
COLUMNS, LINES
HOME
LOCKPRG
NETHACKOPTIONS
PATH
SCREENCAP
SCREENDIR
SCREENRC
SHELL
STY
SYSSCREENRC
TERM
TERMCAP
WINDOW
$SYSSCREENRC, /etc/screenrc
$SCREENRC, $HOME/.screenrc
$SCREENDIR/S-<login>
/run/screen/S-<login>
/tmp/screens/screen-exchange
screenlog.[0-9]
hardcopy.[0-9]
.termcap
/usr/lib/terminfo/?/*, /etc/termcap
/run/utmp
Originally by Oliver Laumann; maintained by Juergen Weigert, Michael Schroeder, Micah Cowan, Sadrul Habib Chowdhury; since 2015 by Amadeusz Slawinski & Alexander Naumov. Many contributors.
dm / xs ignored; xn treated as magic margin.$TERMCAP on reattach with different terminal.-d/-D.breaktype affects all windows, not just current..screenrc.Report bugs to screen-devel AT gnu.org. Recompile with -DDEBUG for debug output.
Requires pseudoβttys, select, Unixβdomain sockets. Run ./configure then make. Socket directory defaults to $HOME/.screen or /run/screen.
See INSTALLATION file in distribution.
Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-31 10:03 @216.73.217.152
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format