screen
yun install -y screen
screen 進入screen視窗
ctrl +a +d 退出screen視窗
screen ls 檢視已經在背景運作的screen
在screen視窗中輸入運作top或者vmst指令然後退出
ps aux | grep -E 'top|vmst'
檢視剛才在screen中運作的top或者vmst服務
[root@hatch ~]# screen #建立一個screen會話
[root@hatch ~]# screen -S test #建立一個帶名字的screen會話,并且attached模式
[root@hatch ~]# screen -dm test1 #并預設是detached模式,也就是建好之後不會連上去。
[root@hatch ~]# screen -d -r test2 #結束目前screen并回到test2這個screen
[root@hatch ~]# screen -ls #檢視所有會話
There are screens on:
8504.test2 (Detached)
8010..hatch (Detached)
8060.test1 (Detached)
6275.test (Attached)
6199.pts-3.hatch (Detached)
5 Sockets in /var/run/screen/S-root.
[root@hatch ~]# screen -r 8060(or test1) #恢複到以前的離線screen程序
[root@hatch ~]# Ctrl+a+d #按Ctrl+a,然後再按d即可保留Screen
[detached] #這時會顯示出這個提示,說明已經保留好Screen了
[root@hatch ~]# exit #如果你工作完成的話,這樣就表示成功退出了
[screen is terminating]
[root@hatch ~]# Ctrl+a+n #下一個screen 會話
[root@hatch ~]# Ctrl+a+p #上一個screen 會話
[root@hatch ~]# Ctrl+a+c #建立新的screen 會話