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. LinqPad介绍,下载,用法说明

    介绍一款用于Linq运算和测试的工具,LinqPad.我感觉这个工具非常优秀,不只是功能上优秀,在使用上也非常优秀,让我爱不释手. LinqPad官方地址:http://www.linqpad.net ...

  2. Windows Live Writer发布CSDN离线博客教程及测试

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

  3. shell 编程 变量

    转自:http://blog.csdn.net/qq504196282/article/details/52994249 shell之变量和引用 分类:SHELL编程基础 (470)  (0)  举报 ...

  4. HashSet小试牛刀

    HashSet详细介绍 import java.util.HashSet; import java.util.Iterator; public class Main { public static v ...

  5. TCP三次握手与防火墙规则

    一个(tct)socket连接需要在客户端与服务端开启一个隧道,客户端提供一个端口(new时可指定,也可不指定,随机),服务端的端口和地址一定要指定.在win下,服务端创建监听端口时,防火墙会提示阻止 ...

  6. android 中 dp和px转换

    DisplayUtils代码: public class DisplayUtil { public static int px2dip(Context context, float px) { flo ...

  7. Linq转换操作之OfType,Cast,AsEnumerable,ToLookup源码分析

    Linq转换操作之OfType,Cast,AsEnumerable,ToLookup源码分析 一:Tolookup 1. 从方法的注解上可以看到,ToLookup也是一个k,v的形式,那么问题来了,它 ...

  8. redis 映射数据结构粗略

    [字符串] sds结构,simple dynamic string.是redis底层字符串实现,结构为: typedef char *sds; struct sdshdr { // buf 已占用长度 ...

  9. ZT 基于git的版本管理思路

    http://nvie.com/posts/a-successful-git-branching-model/ 分为5种分支: feature:功能分支,开发人员在此种分支下开发新的功能,开发完成后m ...

  10. 如何使用jQuery写一个jQuery插件

    jQuery插件其实是前端框架的思维,构成一个框架,个人认为必须满足以下几个基础条件:1. 可重用,2. 兼容性,3. 维护方便,虽说现在有很多比较成熟的前端框架,但是也有部分存在配置麻烦,学习成本大 ...