Install the screen tool, use screen to execute
the Linux system does not have the screen tool by default, you need to install it first.
CentOS series system installation commands are as follows.
yum install screen
The installation commands for Ubuntu series systems are as follows.
sudo apt-get install screen
Introduction
- Create a screen window. Or when you need to run a script or execute a program, just add screen before the command.
screen -S [$Name]
Note: [$Name] is used to mark the purpose of the screen window. - List screen windows.
screen -ls
- Run the screen window in the background
Use Ctrl + a key, and then press the d key to run the screen window in the background, but it will not affect the running of the program in the screen. - Restore the screen window. If you need to continue working, log in to the instance, and then execute the following command to restore the session.
screen -r -d