Help Center

Screen command in CentOs: more efficient sessions

"Screen" is a powerful tool that allows you to create and manage independent terminal sessions on CentOS. Here are some situations where "screen" can be useful:

  • Keep sessions active: If you're performing a task on the server and need to close the connection, "screen" allows you to keep the session active even after closing the terminal. This is especially useful when working in a remote environment and need to keep your tasks running.
  • Run commands in the background: You can use "screen" to run commands in the background while continuing to work on other tasks. This is ideal for running long scripts, compilation processes, or tasks that require time without affecting your current session.
  • Manage multiple sessions: "Screen" allows you to create and switch between multiple terminal sessions easily. You can work on different projects or tasks simultaneously without the need to open multiple terminals or connections.
  • Recover lost sessions: In case of a lost connection or unexpected closure, "screen" allows you to reconnect to previous sessions and resume your work without losing data or progress.

With "screen," you can optimize your workflow on the CentOS server by keeping sessions active, running tasks in the background, and efficiently managing multiple terminal sessions. Follow the instructions below to learn how to use this valuable tool!

In this article, you will learn about the "screen" tool in CentOS, a utility that allows you to create independent terminal sessions. Discover the basic commands and how to make the most of this tool.

  1. Creating a new session:
    • Open a new terminal: screen
    • Enter the session: screen -r
  2. Basic Screen Commands:
    • Create a new window: Ctrl+a, c
    • Switch between windows: Ctrl+a, n (next), Ctrl+a, p (previous)
    • Close a window: exit
  3. Disconnecting and Reconnecting Sessions:
    • Disconnect a session: Ctrl+a, d
    • Reconnect a session: screen -r
  4. Additional Screen Commands:
    • List active sessions: screen -ls
    • Attach to a specific session: screen -r


Using the "screen" tool in CentOS allows you to create and manage terminal sessions efficiently, which is useful for running background tasks and keeping sessions active even after closing the connection. Take advantage of the basic commands and explore all the features that Screen has to offer.

Last updated: 25 de abril de 2024

Estimated reading time: 3 minutes

Did this article help you?
Let's Do It!

Start TODAY for only $2.45/month

Includes a web builder, 30GB of cloud storage, +200 Apps, and professional email.

Sign Up Now