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.

  1. From the command prompt, just run screen. This will give you a new subshell.
  2. Run your desired program
  3. 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.
  4. You can then list the available screen sessions by running "screen -list"
  5. 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
  6. on OSX entering screen -X quit on any terminal terminates all active sessions
  7. 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?的更多相关文章

  1. Screen会话命令 Linux

    由于经常在服务器上运行程序,本地不可能一直和服务器保持连接,而且如果本地和服务器的连接断开,在服务器上运行的程序将会终止,为了,查找了一些网络资料,发现screen 会话命令可以保持本地和服务器断开后 ...

  2. screen command of linux

    [screen command of linux] 常用键:   补充: Ctrl-a S  # split terminal horizon Ctrl-a TAB   # switch to ano ...

  3. Virtualization solutions on Linux systems - KVM and VirtualBox

    Introduction Virtualization packages are means for users to run various operating systems without &q ...

  4. Screen命令让Linux shell在后台运行

    #screen ping ychack.com //挂置后台ping本站 #screen ping baidu.com //挂置后台ping百度 #screen -ls //列出进程 #screen ...

  5. Install MongoDB on Linux Systems 速记

    下载mongodb最新版本: 下载链接:http://pan.baidu.com/s/1kTDnkyz curl -O http://downloads.mongodb.org/linux/mongo ...

  6. 交叉编译工具链介绍《Building Embedded Linux Systems》

    1.前言 配置和编译一个合适的GNU工具链是相对复杂的并且需要很精细的操作,包括你需要对不同软件库之间的依赖关系.它们的各自的任务,不同软件库版本情况都有比较好的了解,编译工具链是一个乏味的工作. 2 ...

  7. pkgmgmt: Comparison between different Linux Systems..

    found this page.. already done by precedents.. installation: aptitude install apt-get install yum in ...

  8. linux screen 命令详解

    一.背景 系统管理员经常需要SSH 或者telent 远程登录到Linux 服务器,经常运行一些需要很长时间才能完成的任务,比如系统备份.ftp 传输等等.通常情况下我们都是为每一个这样的任务开一个远 ...

  9. linux screen 命令详解[转]

    一.背景 系统管理员经常需要SSH 或者telent 远程登录到Linux 服务器,经常运行一些需要很长时间才能完成的任务,比如系统备份.ftp 传输等等.通常情况下我们都是为每一个这样的任务开一个远 ...

随机推荐

  1. 使用word 2013 发布csdn博客

    目前大部分的博客作者在用Word写博客这件事情上都会遇到以下3个痛点: 1.所有博客平台关闭了文档发布接口,用户无法使用Word,Windows Live Writer等工具来发布博客.使用Word写 ...

  2. 获取cpu频率的代码

    taskset是linux自带的一个命令,可用来将进程绑定到指定CPU 相关的函数有: sched_setaffinity, CPU_CLR, CPU_ISSET, CPU_SET, CPU_ZERO ...

  3. Android 内存优化[转]

    一. Android的内存机制 Android的程序由Java语言编写,所以Android的内存管理与Java的内存管理相似.程序员通过new为对象分配内存,所有对象在java堆内分配空间:然而对象的 ...

  4. JavaScript语言精粹 笔记03 继承

    继承伪类对象说明符原型函数化部件 继承 JS不是基于类的,而是基于原型的,这意味着对象直接从其他对象继承. 1 伪类 JS提供了一套丰富的代码重用模式,它可以模拟那些基于类的模式,因为JS实际上没有类 ...

  5. sql语言的一大类 DML 数据的操纵语言

    -DML(insert,update,delete) 1.插入数据insert into 表名(列,列...)values(值,值...)//当插入的数据与表格一一对应时,列可以省略insert in ...

  6. SocketAsyncEventArgs

    SocketAsyncEventArgs是.net提供的关于异步socket类,封装了IOCP的使用,可以用它方便的实现NIO(non-blocking IO) NIO对于提升某些场景下Server性 ...

  7. Redis缓存相关

    Redis缓存服务搭建及实现数据读写 RedisHelper帮助类 /// <summary> /// Redis 帮助类文件 /// </summary> public cl ...

  8. 策略和计费控制(PCC)系统研究

    策略和计费控制(PCC)系统研究 研究内容 [TOC "float:left"] 策略与计费控制(PCC)框架1 [架构图](achitecture.png "Archi ...

  9. 直接导入用户信息到discuz ucenter.

    上一篇帖子: 直接导入帖子到Discuz 论坛数据库. 结束时说要写一篇导入用户的帖子, 一直没时间, 但是咱不能做太监,不是? 所以今天赶快补上. 在做discuz整合或者迁移是, 很多人可能遇到相 ...

  10. SQL SERVER先判断视图是否存在然后再创建视图的语句

    如果我们的语句为: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 IF NOT EXISTS(SELECT 1 FROM sys.views WHERE name='Report_I ...