How to Use Linux Screen Commands and Shortcuts (Quick Guide)

Jian Jye
1 min readMar 8, 2021

--

Photo by Joshua Aragon on Unsplash

Screen is a very powerful tool to keep a process running in the background while retaining the ability to log out and log back in anytime to check on the output.

Annoyingly I keep forgetting the commands to use screen effectively so here’s a quick reference guide of commands and shortcuts for myself and maybe others.

Commands

To start a screen session:

$ screen -S <command>

To list existing screen sessions:

$ screen -ls

To reconnect to a screen session:

$ screen <session_name>

To reconnect to a still attached screen session:

$ screen -rd <session_name>

Shortcuts

To detach a screen session: ctrl + a + d

To open a new screen session while inside screen: ctrl + a + c

To switch back to the previous screen session: ctrl + a + p

To switch to the next screen session: ctrl + a + n

--

--

Jian Jye
Jian Jye

Written by Jian Jye

I write about Laravel, PHP, and web development related articles.

No responses yet