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-Stest#创建一个带名字的screen会话,并且attached模式[root@hatch~]#screen-dmtest1#并默认是detached模式,也就是建好之后不会连上去。[root@hatch~]#screen-d-rtest2#结束当前screen并回到test2这个screen[root@hatch~]#screen-ls#查看所有会话Therearescreenson:8504.test2(Detached)8010..hatch(Detached)8060.test1(Detached)6275.test(Attached)6199.pts-3.hatch(Detached)5Socketsin/var/run/screen/S-root.[root@hatch~]#screen-r8060(ortest1)#恢复到以前的离线screen进程[root@hatch~]#Ctrl+a+d#按Ctrl+a,然后再按d即可保留Screen[detached]#这时会显示出这个提示,说明已经保留好Screen了[root@hatch~]#exit#如果你工作完成的话,这样就表示成功退出了[screenisterminating][root@hatch~]#Ctrl+a+n#下一个screen会话[root@hatch~]#Ctrl+a+p#上一个screen会话[root@hatch~]#Ctrl+a+c#创建新的screen会话