I. What is the screen command?
Screen is a full-Screen window manager that allows multiple processes to reuse one physical terminal. Screen has the concept of session. You can create multiple screen Windows in one screen session, just like operating a real telnet/SSH connection window in each screen window.
Ii. How to install the screen command?
In addition to some streamlined systems or custom systems, most of them have installed the screen command. If not, CentOS can execute: yum install screen;
Run apt-get install screen In Debian/Ubuntu.
3. How to Use the screen command?
1. Common usage
It is used to solve the problems we encountered at the beginning of the article.
1.1 create a screen session
Run screen-S abc to create a session named abc.
1.2 temporarily leave to keep the tasks or programs in the screen session
When you need to temporarily exit (the program in the session will not be closed and is still running), you can press the shortcut key Ctrl + a d (that is, press Ctrl, and then press a, d)
1.3 restore screen sessions
When you return, you can execute screen-r abc to restore the work interface of the abc session created before leaving.
1.4 disable screen sessions
Run: exit. The message [screen is terminating] is displayed, indicating that the screen session has been successfully exited.
Common 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 0th windows and 9th windows