Skip to content

screen command

Keep terminal sessions running and reattach to them later.

On this page

Syntax

screen [options]

Provided by the screen package. Run man screen for the full manual.

Common options

OptionWhat it does
-S NAMEStart a named session
-lsList sessions
-r NAMEReattach to a session
-d -rDetach elsewhere and reattach here
-dmS NAME CMDStart a detached session running CMD
Ctrl+A DDetach (inside screen)

Examples

  1. Start a named session

    screen -S deploy
  2. List sessions

    screen -ls
  3. Reattach

    screen -r deploy
  4. Run a command detached

    screen -dmS backup ./backup.sh
  5. tmux equivalent: new session

    tmux new -s deploy
  6. tmux: reattach

    tmux attach -t deploy

screen guides

← All Linux commands · Suggest a fix

Back to top