Introduction:
There are numerous tools on the market that can boost productivity and make our jobs easier.
Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. It offers the user a standard terminal interface, allowing them to run multiple console applications within a single terminal window or remote terminal session. In this blog, we will go through the steps to install the screen utility on Linux and some common commands related to it.
Installing Screen on Linux:
Checking if screen is already installed: Before installing screen, it’s good to check if it’s already installed on your system. To check, open a terminal window and type the following command:
[root@demo-010]# screen -v
Screen version 4.01.00devel (GNU) 2-May-06
You have mail in /var/spool/mail/root
[root@demo-010]#
If you see the version of screen that’s already installed on your system, you can skip the next steps. If not, move to the next step.
Installing screen: Screen is included in the official repository of most Linux distributions, so you can easily install it using the package manager. Here are the commands to install screen on different distributions:
[root@demo-010]# sudo yum install screen Loaded plugins: fastestmirror Determining fastest mirrors * base: mirrors.tummy.com * extras: mirrors.tummy.com * updates: mirrors.tummy.com Resolving Dependencies --> Running transaction check ---> Package screen.x86_64 0:4.5.0-0.1.20120314git3c2946.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: screen x86_64 4.5.0-0.1.20120314git3c2946.el7 base 626 k Transaction Summary ================================================================================ Install 1 Package Total download size: 626 k Installed size: 2.1 M Is this ok [y/d/N]: y Downloading packages: screen-4.5.0-0.1.20120314git3c2946.el7.x86_64.rpm | 626 kB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : screen-4.5.0-0.1.20120314git3c2946.el7.x86_64 1/1 Verifying : screen-4.5.0-0.1.20120314git3c2946.el7.x86_64 1/1 Installed: screen.x86_64 0:4.5.0-0.1.20120314git3c2946.el7 Complete!
Common Screen Commands:
Start a new screen session: To start a new screen session, type the following command in the terminal:
Screen -S <name>
Detach from a screen session: To detach from a screen session, press Ctrl + A followed by D.
Reattach to a screen session: To reattach to a screen session, type the following command in the terminal:
screen -r <screen name>
List screen sessions: To list screen sessions, type the following command in the terminal:
screen -ls
Kill a screen session: To kill a screen session, type the following command in the terminal:
screen -X -S [session-number] quit
Replace [session-number] with the actual session number you want to kill.
Conclusion:
Screen is a powerful utility that makes it easy to manage multiple console applications within a single terminal window. It’s included in the official repository of most Linux distributions and can be easily installed using the package manager. This blog has covered the steps to install screen on Linux and some common commands related to it. Give it a try and see how it can improve your terminal experience.