How To Install and Configure Screen on Ubuntu

What is this ?

GNU Screen is a terminal multiplexer, a software application that can be used to multiplex several virtual consoles, allowing a user to access multiple separate login sessions inside a single terminal window, or detach and reattach sessions from a terminal.

It is useful for dealing with multiple programs from a command line interface, and for separating programs from the session of the Unix shell that started the program, particularly so a remote process continues running even when the user is disconnected.

In this guide we will install screen, configure and check different options to utilize it.


Applies To: All the Linux hosts like form Debian to Cent-os etc..

Package Install – 

In this section we will go over the steps for installation of screen.

To install screen package, run the command;

apt install screen -y

( Mostly comes preinstalled with modern linux )

Launch – New Screen Session

To initialize / start a new screen session, run the command;

screen

List – Screen Session

To list created screens and that are available to connect, run the command;

screen -ls

Detach – Screen Session

After starting / connecting, to disconnect and keep the processes running without being terminated, you need to detach the screen session, to disconnect an active session run the command;


Ctrl + A and press D or Ctrl + A and Ctrl + D


Lock – Screen Session

At times locking screen would be required typically when you intended to step away from the system, to lock screen run the command; password of the login user has to be entered to unlock the screen session.


Ctrl + X



Wipe – Screen Session

In some scenarios, screen session is abruptly killed or process ID of “SCREEN” is killed in such cases screen session ID is in a defunct or dead state or it is also considered as unreachable session, you have to clean the screen by running the command;

screen -ls

screen -wipe


Thank you.

No comments