@cdmonkey
2018-04-20T13:09:15.000000Z
字数 1193
阅读 980
命令总结
http://blog.chinaunix.net/uid-411974-id-3038242.html
https://www.ibm.com/developerworks/cn/linux/l-cn-screen/
指令功能:用于命令行终端的切换。该指令涉及到的关于中断和进程的知识点较多,具体请参见上述网址内的文档。
当网络断开或终端窗口关闭后,控制进程收到“SIGHUP”信号退出,会导致该会话期内其他进程退出。
[root@Node-A1 ~]# yum install -y screen
指令格式:
screen [ -options ] [ cmd [ args ] ]
screen -r [[pid.]tty[.host]]
screen -r sessionowner/[[pid.]tty[.host]]
[root@Node-A1 ~]# screen # Open a new Session
[root@Node-A1 ~]# ping www.baidu.com
PING www.a.shifen.com (220.181.111.188) 56(84) bytes of data.
64 bytes from 220.181.111.188: icmp_seq=1 ttl=128 time=5.09 ms
64 bytes from 220.181.111.188: icmp_seq=2 ttl=128 time=4.44 ms
64 bytes from 220.181.111.188: icmp_seq=3 ttl=128 time=5.64 ms
...
#这时如果需要从该会话中退出,但希望该任务在后台继续运行,则速要使用组合键:Ctrl a d
[root@Node-A1 ~]# screen
[detached]
-----------------
[root@Node-A1 ~]# screen -ls
There is a screen on:
63583.pts-0.Node-A1 (Detached)
1 Socket in /var/run/screen/S-root.
#
[root@Node-A1 ~]# screen -r 63583
64 bytes from 220.181.111.188: icmp_seq=236 ttl=128 time=8.07 ms
64 bytes from 220.181.111.188: icmp_seq=237 ttl=128 time=4.11 ms
...
ftp://ftp.gnu.org/pub/gnu/screen/
[root@oaimage ~]# tar zxvf screen-4.3.1.tar.gz
[root@oaimage ~]# cd screen-4.3.1
[root@oaimage screen-4.3.1]# ./configure