Screen Cheatsheet

Command Options

Command Description
screen Start a new session
screen -S <name> Start a new session with a session name
screen -ls List running sessions
screen -r [name] Reattach to a running session
screen -X Send a command to a running session
screen -X -S <name> Send a command to a specified session
screen -X -S <name> kill Kill a running session

Command Key in Sessions

By default, Ctrl-a is a special key to send a command to a screen’s session. I call <Leader> like Vim in this document.

Detach

Command Description
<Leader> d Detach the current session
<Leader> : Exit screen

Window

Command Description
<Leader> c Create a new window
<Leader> n or Move to a next window
<Leader> tab Move to a next region
<Leader> p or Move to a previous window
<Leader> Move to a window by number
<Leader> ' Move to a window by number or title
<Leader> " Show window list
<Leader> w Show window bar
<Leader> X Remove the current window
<Leader> Q Remove all windows without the current one

Session

Command Description
<Leader> d Detach the current session
<Leader> S Split a display horizontally
<Leader> | Split a display vertically
<Leader> k Kill the current session