Tutorial on using the SSH remote session management screen tool

888u

Last update at :2024-05-13,Edit by888u

1. What is the screen command?

Screen is a full-screen window manager that can multiplex a physical terminal between multiple processes. Screen has the concept of session. Users can create multiple screen windows in a screen session. In each screen The window is just like operating a real telnet/SSH connection window.

Except for some streamlined systems or customized systems, most of them have the screen command installed. If it is not installed.

CentOS system can execute:

yum install screen

Debian/Ubuntu system execution:

apt-get install screen

3. How to use the screen command?

1. Commonly used methods

Hang up and run some programs, etc.

1.1 Create screen session

You can execute it first:

screen -S vpsxt //screen will create a session named vpsxt.

1.2 Leave temporarily and keep the tasks or programs in the screen session

When you need to leave temporarily (the program in the session will not be closed and is still running), you can use the shortcut key Ctrl+a d (that is, hold down Ctrl and press a, d in sequence)

1.3 Restore screen session

You can execute it again when you come back:

screen -r vpsxt // You can restore to the working interface of the dmdll session created before leaving.

If you forget, or you did not specify a session name at the time, you can execute:

screen -ls // screen will list the currently existing sessions.

For example:

17391.vpsxt is the vpsxt session created by the screen just now. The vpsxt session has been temporarily exited, so the status is Detached,

When screen -r vpsxt is used, the status will change to Attached,

17391 is the process ID of this screen session,

Also available when restoring a session:

screen -r 17391

1.4 Close screen session

Execute: exit, it will prompt: [screen is terminating], indicating that the screen session has been successfully exited.

2. Remote demonstration

First, the presenter executes screen -S test on the server to create a screen session,

The audience can connect to the remote server and execute screen -x test, and the audience's screen will appear synchronized with the presenter.

3. Commonly used shortcut keys

Ctrl+a c: Create a window in the current screen session

Ctrl+a w: window list

Ctrl+a n: next window

Ctrl+a p: Previous window

Ctrl+a 0-9: Switch between the 0th window and the 9th window

Recommended site searches: registered domain name, server high defense Hong Kong, domain name registration query, domain name resolution IP address query, virtual host 99idc, Zhenjiang high defense server, free asp space application for Hong Kong server defense, website registration domain name query, domain name price,

Tutorial on using the SSH remote session management screen tool

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码