[root@hf-01 ~]# screen
在虚拟终端下执行了vmstat 1,按 ctrl+a键 同时按,随后再按 d键 ,就把screen丢到后台了
[detached from 2841.pts-0.hf-01]
[root@hf-01 ~]# screen -ls //列出当前所有的session
There is a screen on:
2841.pts-0.hf-01 (Detached)
1 Socket in /var/run/screen/S-root.
[root@hf-01 ~]# screen -r 2841 //重新回到虚拟终端——>若不需要screen了,直接杀死,按 exit 即可
[screen is terminating]
[root@hf-01 ~]# screen -ls //再次查看,会发现没有screen
No Sockets found in /var/run/screen/S-root.
[root@hf-01 ~]#
[root@hf-01 ~]# screen
[detached from 2880.pts-0.hf-01]
[root@hf-01 ~]# screen
[detached from 2903.pts-0.hf-01]
[root@hf-01 ~]# screen
[detached from 2926.pts-0.hf-01]
[root@hf-01 ~]# screen -ls
There are screens on:
2926.pts-0.hf-01 (Detached)
2903.pts-0.hf-01 (Detached)
2880.pts-0.hf-01 (Detached)
3 Sockets in /var/run/screen/S-root.
[root@hf-01 ~]#