首页 > 其他 > 详细

screen的使用

时间:2016-07-25 00:27:04      阅读:368      评论:0      收藏:0      [点我收藏+]

实验要求:最少两台服务器,而且这两台服务器属于同一台主机

 

先在两台服务器上用yum安装screen

yum install screen -y 

 

第一台服务器创建一个房间

screen -S +房间名

[root@localhost ~]# screen -S an
[root@localhost ~]# ls
anaconda-ks.cfg  Documents  initial-setup-ks.cfg  Pictures  Templates
Desktop          Downloads  Music                 Public    Videos
[root@localhost ~]#


 

第二台服务器查找screen的房间

screen -ls

[root@localhost ~]# screen -ls
There is a screen on:
 23233.an (Attached)
1 Socket in /var/run/screen/S-root.

 

找到第一台服务器创建的房间,第二台服务器加入第一台服务器创建的房间

联通以后,两台服务器就可以同步进行

screen -x +房间名

[root@localhost ~]# screen -x an

[root@localhost ~]# ls
anaconda-ks.cfg  Documents  initial-setup-ks.cfg  Pictures  Templates
Desktop          Downloads  Music                 Public    Videos
[root@localhost ~]#

 

在房间输入 exit 会退出并关闭房间


[root@localhost ~]# ls
anaconda-ks.cfg  Documents  initial-setup-ks.cfg  Pictures  Templates
Desktop          Downloads  Music                 Public    Videos
[root@localhost ~]# ^D
bash: : command not found...
[root@localhost ~]# ctrl +d
bash: ctrl: command not found...
[root@localhost ~]#
[root@localhost ~]# Ctrl+a
bash: Ctrl+a: command not found...
[root@localhost ~]# Ctrl+a
bash: Ctrl+a: command not found...
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# exit

[root@localhost ~]# screen -S an
[screen is terminating]
[root@localhost ~]#

注:这两台服务器必须在同一台主机

 

screen的使用

原文:http://alwaysli.blog.51cto.com/11880605/1829396

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!