screenStarts a new screen session with default settings.
The original terminal multiplexer: detachable sessions, multiple windows and serial-console access.
sudo apt install screenscreen -lsLists all currently active screen sessions and their sockets.
screen -S [name]Starts a new session with a specific descriptive name.
Example
screen -S deployment_opsscreen -r [id]Reattaches to a detached session using its process ID.
Example
screen -r 12345screen -r [name]Reattaches to a detached session using its session name.
Example
screen -r deployment_opsscreen -RReattaches to an existing session or creates it if it does not exist.
Example
screen -R my_sessionscreen -d [name]Remotely detaches a session that is currently attached elsewhere.
Example
screen -d deployment_opsscreen -d -r [name]Detaches a session from another terminal and reattaches it to the current one.
Example
screen -d -r deployment_opsscreen -x [name]Attaches to a session without detaching it elsewhere for multi-display mode.
Example
screen -x joint_sessionscreen -wipeRemoves dead or crashed session sockets from the socket directory.
Ctrl+a cCreates a new window within the current screen session.
Example
Press Ctrl+a then cCtrl+a nSwitches to the next window in the list.
Example
Press Ctrl+a then nCtrl+a pSwitches to the previous window in the list.
Example
Press Ctrl+a then pCtrl+a [0-9]Switches directly to the window with the specified number.
Example
Press Ctrl+a then 1Ctrl+a "Displays an interactive list of all windows for selection.
Example
Press Ctrl+a then "Ctrl+a wDisplays a list of windows on the status line.
Example
Press Ctrl+a then wCtrl+a APrompts to rename the current window title.
Example
Press Ctrl+a then ACtrl+a kKills the current window and its running process.
Example
Press Ctrl+a then kCtrl+a \Kills all windows and terminates the screen session immediately.
Example
Press Ctrl+a then \Ctrl+a SSplits the current region horizontally into two regions.
Example
Press Ctrl+a then SCtrl+a |Splits the current region vertically into two regions.
Example
Press Ctrl+a then |Ctrl+a TabSwitches input focus to the next region.
Example
Press Ctrl+a then TabCtrl+a QCloses all regions except the currently focused one.
Example
Press Ctrl+a then QCtrl+a XCloses the currently focused region.
Example
Press Ctrl+a then Xscreen -LStarts a session with automatic output logging enabled.
Example
screen -L -S monitored_sessionscreen -Logfile [file]Defines the specific filename for the session output log.
Example
screen -L -Logfile session.logCtrl+a HToggles logging on or off for the current window.
Example
Press Ctrl+a then HCtrl+a hWrites a hardcopy of the current view to a file.
Example
Press Ctrl+a then hCtrl+a xLocks the screen terminal requiring a password to unlock.
Example
Press Ctrl+a then xscreen -d -m [cmd]Starts a session in detached mode running a specific command.
Example
screen -d -m ./start_server.shscreen -X [cmd]Sends a command to a running screen session without attaching.
Example
screen -S session_name -X quitscreen -X stuffInjects keystrokes or strings into a running session window.
Example
screen -S sess -X stuff 'ls^M'screen -X screenCreates a new window running a command in a remote session.
Example
screen -S sess -X screen topdefscrollback [num]Sets the default scrollback buffer size for new windows.
Example
Add 'defscrollback 10000' to .screenrcescape [key]Changes the command character from Ctrl-a to Ctrl-b.
Example
Add 'escape ^Bb' to .screenrchardstatus alwayslastlineConfigures the status bar to always appear at the bottom.
Example
Add 'hardstatus alwayslastline' to .screenrcstartup_message offDisables the copyright notice screen on startup.
Example
Add 'startup_message off' to .screenrcmultiuser onEnables multi-user mode for the current session.
Example
Press Ctrl+a :multiuser onacladd [user]Grants a specific user permission to access the session.
Example
Press Ctrl+a :acladd operator1acldel [user]Revokes a user's permission to access the session.
Example
Press Ctrl+a :acldel operator1aclchg [user] [perms]Modifies user permissions to read-only or write access.
Example
Press Ctrl+a :aclchg operator1 -wscreen -qSuppresses error messages for cleaner script output.
Example
screen -q -lsCtrl+a tDisplays the system time and load average.
Example
Press Ctrl+a then tCtrl+a vDisplay the version and compilation date.
Example
Press Ctrl+a then vCtrl+a ZResets the virtual terminal to its default state.
Example
Press Ctrl+a then ZCtrl+a *Lists all currently connected displays.
Example
Press Ctrl+a then *Ctrl+a _Monitors the window for silence (inactivity).
Example
Press Ctrl+a then _Ctrl+a MMonitors the window for activity or output.
Example
Press Ctrl+a then Mscreen -D -mStarts a session detached and doesn't fork a new process.
Example
screen -D -m ./honeypot.shCtrl+a :logfileChanges the log filename dynamically while running.
Example
Press Ctrl+a :logfile /var/log/screen.logCtrl+a :log onForces logging on for evidence collection immediately.
Example
Press Ctrl+a :log onscreen -x -X lockscreenRemotely locks a shared session to prevent unauthorized input.
Example
screen -x session_name -X lockscreenvbell offDisables the visual bell flash for stealthier operation.
Example
Add 'vbell off' to .screenrcscreen -S [name] -p [win] -X killRemotely kills a specific window in a session without attaching.
Example
screen -S incident -p 2 -X killscreen -p [n] -X stuffSends a shell command to window 0 of a detached session.
Example
screen -S main -p 0 -X stuff #x27;ls\n'screen -Q windowsQueries a detached session for a list of active windows.
Example
screen -S main -Q windowsscreen -X evalExecutes multiple screen commands sequentially in one call.
Example
screen -X eval 'split' 'focus' 'screen'screen -X readregReads the contents of a file into a screen paste register.
Example
screen -X readreg p /tmp/bufferscreen -X pastePastes contents from a specific register into the window.
Example
screen -X paste pscreen -S [name] -X hardcopy -h [file]Saves the full scrollback buffer to a file for forensics.
Example
screen -S breach -X hardcopy -h /tmp/dumpCtrl+a :sessionnameRenames the current session to reflect incident status.
Example
Press Ctrl+a :sessionname investigation_01Ctrl+a :wrapToggles line wrapping to preserve long log lines.
Example
Press Ctrl+a :wrap onlayout save [name]Saves the current split region layout configuration.
Example
Press Ctrl+a :layout save monitoringlayout load [name]Restores a previously saved split region layout.
Example
Press Ctrl+a :layout load monitoringlayout autosave onAutomatically saves the layout when changes occur.
Example
Press Ctrl+a :layout autosave onbind [key] [cmd]Binds a specific key to a screen command.
Example
Add 'bind k kill' to .screenrcbindkey [seq] [cmd]Binds a keyboard function key to a screen command.
Example
Add 'bindkey -k F1 prev' to .screenrcscreen -X colonForces the session to enter the command prompt mode.
screen -r [name] -XReattaches and immediately executes a sequence of commands.
Example
screen -r session -X eval 'split' 'focus' 'screen top'screen -X atExecutes a command specifically in window number 2.
Example
screen -X at 2 stuff 'exit^M'screen -X otherSwitches the window to the previously used window.
screen -X removeDestroys the current region in split mode remotely.
screen -X selectForces the session to switch to window 0.
Example
screen -X select 0zombie [keys]Keeps windows open after the process dies for inspection.
Example
Add 'zombie kr' to .screenrcautodetach onAutomatically detaches the session on SIGHUP instead of terminating.
Example
Add 'autodetach on' to .screenrcpow_detach_msgDisables the message displayed when detaching.
Example
Add 'pow_detach_msg none' to .screenrcmsgminwait 0Reduces the wait time for status messages to zero.
Example
Add 'msgminwait 0' to .screenrcA terminal multiplexer: split windows into panes, keep sessions alive after disconnect and script complex layouts.
OpenSSH: secure remote login, key management, file transfer and port forwarding — local, remote and dynamic SOCKS tunnels.
Runs a command repeatedly and shows its output full-screen, highlighting what changes between runs.