Basic screen command usage

  • Start a screen session.
1
screen
  • Exit a screen session: ctrl + a + d- View all current screen sessions.
1
screen -ls
  • Reconnecting a screen session.
1
screen -r sessionid
  • Force reconnection of a screen session.
1
screen -dr sessionid

Screen session management

  • Creates a named screen session:
1
screen -S sessionname
  • Create a new window in a screen session: ctrl + a + c - Switch between screen windows: ctrl + a + window number - Temporarily disconnect a screen session: ctrl + a + d - Kill a screen session.
1
screen -X -S sessionid quit
  • Kill all disconnected screen sessions.
1
screen -wipe

Advanced Screen Usage

  • Monitor a process.
1
screen -dmS sessionname command
  • Start multiple screen sessions at the same time.
1
2
screen -d -m -S session1 command1
screen -d -m -S session2 command2
  • Record a screen session.
1
screen -L -S sessionname
  • Play Recorded Sessions.
1
screen -r -L sessionname