Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the screen command

2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to use the screen command, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Screen is a free software developed by GNU for command line terminal switching. Through the software, users can connect multiple local or remote command line sessions at the same time and switch freely between them. GNU Screen can be thought of as the command-line interface version of the window manager. It provides a unified interface for managing multiple sessions and corresponding functions.

How to install screenscreen

It has been preinstalled on some popular distributions. You can use the following command to check if it has been installed on your server.

Screen-vScreen version 4.00.03 (FAU)

If you don't already have screen in Linux, you can easily install it using the package manager provided by the system.

CentOS/RedHat/Fedorayum-y install screen

Ubuntu/Debian

Apt-get-how does y install screen start a screen session

You can start it by typing screen on the command line, and a screen session that looks like a command prompt will start.

Screen

It is a good practice to start a screen session with a descriptive name so that you can easily remember the processes that are running in the session. To create a new session with the session name, run the following command:

Screen-S name

Replace "name" with a name that is meaningful to your conversation.

Detach from a screen session

To detach from the current screen session, press Ctrl-An and d. All screen sessions will remain active and you can reconnect at any time later.

Reconnect to the screen session

If you are detached from a session, or if your connection is disconnected for some reason, you can reconnect with the following command:

Screen-r

If you have multiple screen sessions, you can list them with the ls parameter.

Screen-lsThere are screens on:7880.session (Detached) 7934.session2 (Detached) 7907.session1 (Detached) 3 Sockets in / var/run/screen/S-root.

In our example, we have three active screen sessions. So, if you want to restore the "session2" session, you can execute:

Screen-r 7934

Or use the screen name.

Screen-r-S session2 aborts a screen session

There are several ways to abort a screen session. You can press Ctrl+d or use the exit command on the command line.

To see all the useful features of the screen command, you can check out screen's man manual.

Man screenNAMEscreen-screen manager with VT100/ANSI terminal emulationSYNOPSISscreen [- options] [cmd [args]] screen-r [[pid.] tty [.host]] screen-r sessionowner/ [[pid.] tty [.host]]

The above is all the contents of this article "how to use screen commands". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report