---
title: 'Basics of working with the screen utility | Zomro'
description: 'The article discusses the basic commands and the principle of working with the screen utility for launching programs for long-term execution on the server.'
image: 'https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a44@server-panel.net/2022/12/01/1671362177_1671362125548.png'
---

![opened image]()

  * [Zomro](https://zomro.com/)
  * [FAQ](https://zomro.com/blog/faq/)
  * Basics of working with the screen utility 



# Basics of working with the screen utility

09-12-2022

The screen utility can be useful on a server running a Linux operating system. From the man page: Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells). This utility can be used, for example, if you need to start a process manually and then disconnect from the server. Or it is necessary to save the session if there is a possibility of losing the session, or the possibility that some abnormal disconnection from the server will occur, for example, when the Internet connection fails.  
  
To work with the screen utility, you will need to connect to the server via ssh. (Our blog has a separate article about this)

## **How to install the screen utility**

  
To install the screen utility run in deb-like distributions:
    
    
    apt-get install screen

  
In rpm-like ones:
    
    
    yum installscreen

  
To run the utility, enter the following at the command line:
    
    
    screen

  
You can also start a session with a name, for example:
    
    
    screen -S archiving

  
After entering these commands, a screen session is created, which looks like a regular terminal. You can work in it like in a regular terminal, enter commands, including launching long processes, which, presumably, can be interrupted in work.  
  
The screen session can be disconnected and you can disconnect from the server, continue to perform other tasks, or start another screen. To detach from screen, type **Ctrl+a, d** on the keyboard (first press **Ctrl+a** together, then **d**). You will return to the previous mode of your ssh session, from which you can disconnect.  
  
Multiple screen sessions can be opened. If you do not specify a name when creating a session, it will be assigned a numeric identifier and a default name. To view a list of screen sessions, run the command:
    
    
    screen -ls

![Basics of working with the screen utility - 1](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a44@server-panel.net/2022/12/01/1671362177_1671362125548.png)

  
In the output, you can see a list of sessions: their identification number and name. If no name has been given, it is added automatically (for example, pts-0.myserver).  
  
To rejoin an existing session (if there was one), run the command:
    
    
    screen -r

  
If there are multiple sessions, a list of existing ones will be displayed. To join a specific session, you must specify its name. For example,
    
    
    screen -r archiving

  
or
    
    
    screen -r 30887

  
To exit the screen session and close it, type **exit** or press **Ctrl+d**.  
  
Not all possibilities of this utility are considered. There are many other command line options, as well as commands that can be used inside a screen session (such as creating windows, switching between them, and many others). In order to learn all the features of the program, refer to its reference manual:
    
    
    man screen

  
You can get help on the combinations that can be used inside screen by first pressing **Ctrl+a** followed by the "**?** " character.

![Basics of working with the screen utility - 2](https://dx86q6oq7ry0e.cloudfront.net/uploads/media/blog/a44@server-panel.net/2022/12/01/1671361766_1671361737355.png)

### Conclusion

The main features of the screen utility, the creation of sessions from which you can disconnect or run long processes without fear of disconnecting from the server, were considered.

We also suggest you other useful articles:

  * [How to create a Telegram bot for monitoring remote hosts](https://zomro.com/blog/faq/316-kak-sozdat-telegram-bota-dlja-monitoringa-udalennyh-hostov)
  * [htop - Linux interactive system monitor](https://zomro.com/blog/faq/314-htop-interaktivnyj-sistemnyj-monitor-linux)
  * [Connecting to the VPS server via SSH using a key](https://zomro.com/blog/faq/235-podkljuchenie-k-serveru-cherez-ssh-po-kljuchu-s-nestandartnym-portom)



Similar articles:

[VestaCP: Installing Wordpress in the console (from creating a domain to getting a ready site)](https://zomro.com/blog/faq/209-vestacp-ustanovka-wordpress-v-konsoli-ot-sozdanija-domena-do-poluchenija-gotovogo-sajta) [How to fix black screen in RDP connection](https://zomro.com/blog/faq/502-how-to-fix-black-screen-in-rdp-connection) [How to add a rule to Windows Server 2012, 2016, 2019 Firewall](https://zomro.com/blog/faq/273-kak-dobavit-pravilo-v-brandmaujer-windows-server-2012-2016-2019) [How to install phpMyAdmin in Docker](https://zomro.com/blog/faq/289-kak-ustanovit-phpmyadmin-v-docker) [How to view Centos 7 server logs](https://zomro.com/blog/faq/350-how-to-view-centos-7-server-logs)

[ Virtual hosting from €3.98/mon ](/virtual)
