[关闭]
@cdmonkey 2018-04-20T05:09:15.000000Z 字数 1193 阅读 908

screen

命令总结


http://blog.chinaunix.net/uid-411974-id-3038242.html

https://www.ibm.com/developerworks/cn/linux/l-cn-screen/

一、简介

指令功能:用于命令行终端的切换。该指令涉及到的关于中断和进程的知识点较多,具体请参见上述网址内的文档。

当网络断开或终端窗口关闭后,控制进程收到“SIGHUP”信号退出,会导致该会话期内其他进程退出。

二、安装及使用

1. 安装

Yum Install

  1. [root@Node-A1 ~]# yum install -y screen

指令格式:

  1. screen [ -options ] [ cmd [ args ] ]
  2. screen -r [[pid.]tty[.host]]
  3. screen -r sessionowner/[[pid.]tty[.host]]
  1. [root@Node-A1 ~]# screen # Open a new Session
  2. [root@Node-A1 ~]# ping www.baidu.com
  3. PING www.a.shifen.com (220.181.111.188) 56(84) bytes of data.
  4. 64 bytes from 220.181.111.188: icmp_seq=1 ttl=128 time=5.09 ms
  5. 64 bytes from 220.181.111.188: icmp_seq=2 ttl=128 time=4.44 ms
  6. 64 bytes from 220.181.111.188: icmp_seq=3 ttl=128 time=5.64 ms
  7. ...
  8. #这时如果需要从该会话中退出,但希望该任务在后台继续运行,则速要使用组合键:Ctrl a d
  9. [root@Node-A1 ~]# screen
  10. [detached]
  11. -----------------
  12. [root@Node-A1 ~]# screen -ls
  13. There is a screen on:
  14. 63583.pts-0.Node-A1 (Detached)
  15. 1 Socket in /var/run/screen/S-root.
  16. #
  17. [root@Node-A1 ~]# screen -r 63583
  18. 64 bytes from 220.181.111.188: icmp_seq=236 ttl=128 time=8.07 ms
  19. 64 bytes from 220.181.111.188: icmp_seq=237 ttl=128 time=4.11 ms
  20. ...

Make Install

ftp://ftp.gnu.org/pub/gnu/screen/

  1. [root@oaimage ~]# tar zxvf screen-4.3.1.tar.gz
  2. [root@oaimage ~]# cd screen-4.3.1
  3. [root@oaimage screen-4.3.1]# ./configure

http://www.dbafree.net/?p=870

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注