码迷,mamicode.com
首页 > 其他好文 > 详细

screen的使用

时间:2016-07-25 00:28:03      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:screen

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

 

先在两台服务器上用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的使用

标签:screen

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!