快速业务通道

Linux下Screen的常用命令

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-04-02

向您推荐以下文章,已经将链接贴出来啦.

linux 技巧:使用 screen 管理你的远程会话

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

详细资料参考以上链接,最下面是本人的一些实际操作,仅供参考:

已经将个人示例的系统版本和YUM库的配置列出来了

1、新建screen会话:直接输入screen命令或者screen -S [会话名称]

2、退出会话:按下组合键Ctrl a并松开,此时screen窗口等待命令,然后按下d并松开,退出screen窗口.

3、查看当前系统所有screen会话:screen -ls

4、进入某个screen会话:screen -r [会话的PID]

5、在进入某个screen会话后,杀死screen会话:按下组合键Ctrl a并松开,此时screen窗口等待命令,然后按下大写的K(即组合键:Shift k)并松开,(系统提示是否要杀死)按下y确认杀死screen会话.

总结:当系统中只有一个screen会话时,输入:screen -r 即可进入这个会话,

当系统中有多个screen会话时,此时输入同样的命令,系统会列出当前所有screen回话,相当于命令:screen -ls

更多的关于screen的参数,可以参考手册:man screen

同时还要多多实际操作,会得到更多的切身体会,希望本文能够对感兴趣的读者有所帮助,欢迎转载,很愿意分享分享,共同成长,谢谢!

[root@localhost ~]# cat /etc/issue
CentOS release 5.4 (Final)
Kernel r on an m

[root@localhost ~]# cat /etc/yum.repos.d/CentOS-Base.repo # CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/5.5/os/i386/
enabled=1
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 [root@localhost ~]# screen
-bash: screen: command not found
[root@localhost ~]# yum -y install screen
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: data.nicehosting.co.kr
* base: mirror01.idc.hinet.net
* extras: data.nicehosting.co.kr
* updates: data.nicehosting.co.kr
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package screen.x86_64 0:4.0.3-1.el5_4.1 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved ==============================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================
Installing:
screen x86_64 4.0.3-1.el5_4.1 base 571 k
Transaction Summary
==============================================================================================================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号