How do I use screen on the Linux systems?
Scope
The screen utility provides a way to run a command on a Linux system, detach from it, and then reattach later. This is particularly handy if you have a long-running process that you want to keep running even after you log out and still have the ability to reattach to it later and/or from another location.
This is general information about using screen that applies to just about every Linux system, not just those in the School of Informatics and Computing.
Basic Screen Usage
There are many good tutorials available on the web describing the use of screen. There is also detailed information in the screen man page, which you can view by running man screen. However, much of this information can be rather daunting given the sheer number of command line arguments and key bindings. The purpose of this page if to give you the bare minimum of information needed to get started with screen.
Here are the steps you can follow to run a process in screen, detach from the terminal, and then reattach.
- From the command prompt, just run screen. This will give you a new subshell.
- Run your desired program
- Detatch from the screen session using the key sequence Ctrl-a Ctrl-d (note that all screen key bindings start with Ctrl-a). This will drop you back to your original shell and display a message "[detached]", indicating that the screen session is still running.
- You can then list the available screen sessions by running "screen -list"
- You can reattach to this screen session by running "screen -r". Once reattached, you will be able to take off where you left off and see any output that was printed to the screen during the time that you were detached. If you have multiple screen sessions, then you can specify the tty name (as displayed by screen -list) as an argument to screen -r to attach to a particular session
- on OSX entering
screen -X quit
on any terminal terminates all active sessions - on linux
List screens:
screen -list
Output:
There is a screen on:
23536.pts-0.wdzee (10/04/2012 08:40:45 AM) (Detached)
1 Socket in /var/run/screen/S-root.
Kill screen session:
screen -S 23536 -X quit ('exit' also work?)
Kerberos Issues
If you are using screen on the available SoIC Unified Linux Systems that are using the Unified Workstation Configuration you will need to take special care when using screen to keep your kerberos credentials alive. For example, this is necessary if you are running screen on a workstation in LH035 but not if you are using a server like silo, tank, or hulk.
Please see the Running Persistent Remote Processes section of the KB article Understanding Linux Kerberos Issues for details on how you can keep your kerberos credentials alive in your screen session. Failure to follow the procedure detailed in that KB page will result in your screen session losing access to your networked home directory. When this happens, it can result in excessive load being put on the home directory file server and it may be necessary for systems staff to kill your screen session.
How do I use screen on the Linux systems?的更多相关文章
- Screen会话命令 Linux
由于经常在服务器上运行程序,本地不可能一直和服务器保持连接,而且如果本地和服务器的连接断开,在服务器上运行的程序将会终止,为了,查找了一些网络资料,发现screen 会话命令可以保持本地和服务器断开后 ...
- screen command of linux
[screen command of linux] 常用键: 补充: Ctrl-a S # split terminal horizon Ctrl-a TAB # switch to ano ...
- Virtualization solutions on Linux systems - KVM and VirtualBox
Introduction Virtualization packages are means for users to run various operating systems without &q ...
- Screen命令让Linux shell在后台运行
#screen ping ychack.com //挂置后台ping本站 #screen ping baidu.com //挂置后台ping百度 #screen -ls //列出进程 #screen ...
- Install MongoDB on Linux Systems 速记
下载mongodb最新版本: 下载链接:http://pan.baidu.com/s/1kTDnkyz curl -O http://downloads.mongodb.org/linux/mongo ...
- 交叉编译工具链介绍《Building Embedded Linux Systems》
1.前言 配置和编译一个合适的GNU工具链是相对复杂的并且需要很精细的操作,包括你需要对不同软件库之间的依赖关系.它们的各自的任务,不同软件库版本情况都有比较好的了解,编译工具链是一个乏味的工作. 2 ...
- pkgmgmt: Comparison between different Linux Systems..
found this page.. already done by precedents.. installation: aptitude install apt-get install yum in ...
- linux screen 命令详解
一.背景 系统管理员经常需要SSH 或者telent 远程登录到Linux 服务器,经常运行一些需要很长时间才能完成的任务,比如系统备份.ftp 传输等等.通常情况下我们都是为每一个这样的任务开一个远 ...
- linux screen 命令详解[转]
一.背景 系统管理员经常需要SSH 或者telent 远程登录到Linux 服务器,经常运行一些需要很长时间才能完成的任务,比如系统备份.ftp 传输等等.通常情况下我们都是为每一个这样的任务开一个远 ...
随机推荐
- SQL 语句常用函数
一.字符转换函数 1.ASCII()返回字符表达式最左端字符的ASCII 码值.在ASCII()函数中,纯数字的字符串可不用‘’括起来,但含其它字符的字符串必须用‘’括起来使用,否则会出错. 2.CH ...
- 【QTP专题】04_对象及操作方法
本节介绍知识点包括 1.QTP自动化的原理 2.两类对象:TO(测试对象).RO(运行对象) 3.操作方法:SetTOProperty,GetROProperty,GetTOProperty 1.QT ...
- NOIP提高组题目归类+题解摘要(2008-2017)
因为前几天作死立了一个flag说要把NOIP近十年的题目做一做,并写一个题目归类+题解摘要出来,所以这几天就好好的(然而还是颓废了好久)写了一些这些往年的NOIP题目. 这篇博客有什么: 近十年NOI ...
- 参照跟老男孩学linux运维搭建nagios实验小结
nagios效果示例 http://192.168.0.236/nagios 用户名:hong 密码:123 一. 服务端安装准备 1. 更新源 cd /etc/y ...
- Ping程序
一.概述 Ping程序是对两个TCP/IP系统连通性进行测试的基本工具.该程序发送一份ICMP回显请求报文给主机,并等待返回ICMP回显应答. 二.格式 大多数TCP/IP实现都在内核中直接支持Pin ...
- PHP将多维数组变成一维数组
function reduceArray($array) { $return = []; array_walk_recursive($array, function ($x) use (&$r ...
- 《UltraFast设计法实践》系列目录
最近准备开始潜心学习快速和高效的时序收敛设计了,突然想就把整个学习过程做成一个博客系列吧,虽然想想就很激动(技术狗就这么点出息--),但希望坚持下来. 这篇做个目录或者索引,不断向其中添加学习内容. ...
- docker 安装sentry
主页:https://sentry.io/welcome/ 环境安装 请先安装 Docker 1.10+ ,使用 CE 版本:安装文档,写的很清晰,不详述:因为国内网络环境问题,一般建议 docker ...
- C#集合之位数组
如果需要处理的数字有许多位,就可以使用BitArray类和BitVector32结构.BitArray类位于System.Collection,BitVector32结构位于System.Collec ...
- 2018 ICPC Asia Jakarta Regional Contest
题目传送门 题号 A B C D E F G H I J K L 状态 Ο . . Ο . . Ø Ø Ø Ø . Ο Ο:当场 Ø:已补 . : 待补 A. Edit Distance Thin ...