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

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

--

--

--

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

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

You don’t get to decide if your product is a platform

Kotlin — Ktor Foundations

Create a PowerBi account with your personal email.

I’ve written a cli tool and not marketed it, it still got 1000 npm installs in one week

Traefik Ingress with Kubernetes on AWS

Unity: Get Going with Git

Stack of metal squares with rounded corners

Object Oriented Programming(Oops)

Download CloudHub Application Log Files Using Anypoint CLI

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jian Jye

Jian Jye

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

More from Medium

Setup AWS CLI on MAC, Windows and Linux

Every Linux user should know these commands

Install your personal RMM in no time and for free

How To Install PHP 8.1 on Ubuntu 22.04