How to Install Screen in Amazon Linux 2

This article is a quick guide to installing screen in Amazon Linux 2. Screen allows you to open up multiple terminal sessions and detach from them so that they are still running even if you disconnect or log out of your shell.

What is screen?

Screen is a tool for multiplexing terminal sessions. It allows for the screen to be opened, accessed, and closed at any time without losing what is being done on screen.

  • Screen will allow you to open up a session even if you have logged out of your shell or disconnected from it
  • You can detach it from the screen as well so that it stays running

How to install screen in Amazon Linux 2

Installing the screen is as easy as using the Yum package manager, which is used for managing packages on Amazon Linux 2. First login to your EC2 instance using terminal or Putty. The following command will install the screen

sudo yum install screen -y

To check if the installation worked fine, please run this command

screen --version

Why should I use it?

The screen is used to keep terminals open so that they can be accessed later on without having to reconnect or login again. The screen allows you to run commands for hours if needed without any interruptions because it works as a window manager. So using the screen you can run some background tasks without even logging into your server.

Screen commands overview

There are a few important commands on the screen that you should know about.

This will list all active screen sessions.

screen -L

To start a new screen session with a name, type this command

screen -S atiq

To enter the screen session run this command.

 screen -r

To list down all the screen IDS, please run this command

screen -ls

 screen -x 

screen -x with no parameter is used for suspending an existing screen session and finally pressing d to detach from it.

Examples of how you can use the screen and when not to use it

Here I list below some examples of screen usage and when the screen should not be used.

Conclusion

It’s time to get your screen working in Amazon Linux 2. In this quick guide, we will walk you through the process of installing a Screen package on Amazon Linux 2 and show you how it works with some basic example usage commands. Subscribe to our YouTube channel for more details!

Interested more in Linux? Please check out my other articles below.

Setup SWAP in Linux

Install MongoDB in Amazon Linux

Atiqur Rahman

I am MD. Atiqur Rahman graduated from BUET and is an AWS-certified solutions architect. I have successfully achieved 6 certifications from AWS including Cloud Practitioner, Solutions Architect, SysOps Administrator, and Developer Associate. I have more than 8 years of working experience as a DevOps engineer designing complex SAAS applications.

This Post Has 3 Comments

  1. Julia

    The screen examples are not published

    1. Atiqur Rahman

      I don’t get your point. Did you got any error while running these commands in amazon linux 2?

  2. mrducky

    I think the point is the article says “Here I list below some examples of screen usages …” but there is nothing there.

Leave a Reply