Screen Command

Table of Contents

Cheat sheet.

Start and Exit

Command Usage
screen Start a screen session with a window with a shell. Start a new window if already in a screen session.
exit Exiting the shell will exit the current window. Screen session will also end if it is the last window.
screen <program> Start a program within a screen window. Exiting the program will also terminate the window.

Hot Key

Screen default hot-key is ctrl+a, then follow by a command key. Following are some frequently used command keys:

Press ctrl+a, then press one of the following keys.

Command Key Usage
? Display help.
c Create and enter a new window.
" List and choose window.
A Change name / title of a window.
S Split the terminal.
Q Remove all split areas other than the current focused one.
X Remove the currently focused split area.
ctrl+I Cycle cursor focus through splitted area.
0 1 2 3 4 5 6 7 8 9 Quick switch between window 0-9.
k Kill current window.
d Detect the screen session.
ctrl+\ Kill all windows and exit screen.

Command Line Options

Some frequently use command line options:

screen <option>
Options Usage
-ls List socket name and status.
-D If inside a screen session, will detach the session and terminate the terminal process with it.
-r <socket> Re-attach to a screen session.
-S Set socket name other than <pid>.<tty>.<host>.
John Siu
Minimize the Effort, Maximize the Effect!
comments powered by Disqus