Introduction to Linux Screen
This is supposed to be a concise tutorial and you should not spend longer than 10 minutes to go through it.
What is Linux screen?
Screen is a terminal multiplexer. Processes running inside a screen will continue to run even their windows are not visible or are disconnected.
The screen package is preinstalled in most Linux distros nowadays. To check its version, use screen --version
. If you don't have it installed on your machine, you can install it by using the package manager of your distros.
Starting and terminating Linux screen
To start a screen session, use the command screen -S session_name
. Note that it is also possible to give it a name; however, named sessions are useful when you run multiple screen sessions. It is always a good practice to use a descriptive session name. The program running inside the screen session will continue to run even you close the window. To terminate a screen, use exit
.
Reattaching a Linux screen
To resume your screen session, use screen -r
. In case that you have many screen sessions, you need to specify the name, too, i.e., screen -r screen_name
.
To list all session names, use screen -ls
.
References
This tutorial is summarized and is revised from:
Other blogged posts >> Tutorials