screen virtual terminal tool

Note: Sometimes we want to execute a command or script that takes hours or even days, but it can not be interrupted, sometimes you want to see when output current information, it can be thrown into the background, but running in the background can not display or output information out; we can use a virtual terminal screen tool to achieve, a virtual terminal is directly above run the script or command to hide the background, but could be released at any time to view the current schedule and information
 
1: Installation screen
[root@ghs ~]#yum -y install screen
 
 
2: Create a new virtual terminal
[root@ghs ~]# screen
 
## enter the terminal does not need to keep the final run-off, ctrl key and press a + d and exit the terminal holding the terminal operation interface
 
 
3: The query is run virtual terminal
[root@ghs ~]#screen -ls
There are screens on:
    22849.pts-0.ghs    (Detached)
2 Sockets in /var/run/screen/S-root.
 
## 22890 is ID, pts-0.ghs terminal name of the terminal!
 
 
4: running into the terminal
[root@ghs ~]#screen -r   22849
 
## the terminal ID or the terminal can add the name
 
 
5: Specify the name of the terminal
[root@ghs ~]#screen -S  test
 
## can not see the name of the terminal pts-0.ghs, specify the name of the test
[root@ghs ~]#screen -ls
There are screens on:
    22890.test    (Detached)
    22849.pts-0.ghs    (Detached)
2 Sockets in /var/run/screen/S-root.
 
 
If you want to terminate the operation of the terminal, you can return to the terminal interface termination want, enter exit to exit!
 

Guess you like

Origin www.cnblogs.com/douyi/p/11584112.html