Tutorial to use Linux GNU screen in Linux based operating system.
Linux Screen or GNU Screen is a terminal multiplexer that lets you use several virtual terminal inside a session. It is useful when you need to deal with multiple programs from a command line. Programs continue to run when their window is currently not visible and even when the whole screen session is detached from the users terminal.
How To Use Linux GNU Screen
Install Linux GNU Screen
These days, the Linux Screen package is pre-installed on most of the Linux based operating systems. Run the following command to make sure that you have your copy of the Linux screen.
screen --version
You will see output something like this:
Screen version 4.8.0 (GNU) 16-Aug-30
If you don’t have Linux screen installed in your operating system, then follow the instructions below:
Install Linux Screen on Ubuntu and Debian based operating systems
sudo apt update
sudo apt install screen
Install Linux Screen on CentOS/RHEL and Fedora
sudo yum install screen
How To Start Linux Screen
Start a Linux screen with the following command:
Screen
It is always better to give a name to the sessions when you are going to run multiple screen sessions.
screen -S session_name
Some of the regularly used Linux screens commands:
Ctrl+a
c
Command to create a new window (with shell)Ctrl+a
"
Command to list all windowCtrl+a
0
Switch to window 0 (by number )Ctrl+a
A
The command to rename the current windowCtrl+a
S
Command to split current region horizontally into two regionsCtrl+a
|
Split current region vertically into two regionsCtrl+a
tab
Command to switch the input focus to the next regionCtrl+a
Ctrl+a
Toggle between the current and previous regionCtrl+a
Q
Close all regions but the current oneCtrl+a
X
Command to close the current region
You can detach from the screen session at any time by running the following command:
Ctrl+a
d
Featured image: Opensource.com