基本使用

SSH时可以方便地resume工作

 # open new screen session
screen
# restore
# -d: use the -d option to detach the screen session from the terminal where it's in.
# https://unix.stackexchange.com/questions/240444/cant-resume-screen-says-i-am-already-attached
screen -rd <session_number>

Steps Using GNU Screen

  1. Connect. Connect to a remote server and create a Screen session via ssh -t <server.domain.name> screen -R
  2. Detach. When done with the SSH session, use ctrl-a d to detach from the session. This also disconnect with the SSH server.
  3. Reconnect. The SSH session is still running actually. When you are ready to resume working with the session, use ssh -t <server.domain.name> screen -R again to reconnect, then you are right where you left it.
  4. Terminate. To permanently terminate a Screen session, just disconnect from the server the usual way (ctrl-d).

Limitation: If you are using apps with graphical interface, not just the command line environment, then screen is not suitable for resuming such jobs, and VNC instead would be the ideal choice.

https://bobbielf2.github.io/blog/2017/09/14/using-gnu-screen-to-resume-an-ssh-session/

如何Scroll Back以及设置Scroll Buffer大小

ctrl+a+ESC: copy mode
you can scroll
ESC: exit copy mode
ctrl+a+: then type scrollback 999999

Screen has its own scroll buffer, as it is a terminal multiplexer and has to deal with several buffers.

Maybe there's a better way, but I'm used to scrolling using the "copy mode" (which you can use to copy text using screen itself, although that requires the paste command too):

  • Hit your screen prefix combination (C-a / control+A by default), then hit Escape.

  • Move up/down with the arrow keys (↑ and ↓).

  • When you're done, hit q or Escape to get back to the end of the scroll buffer.

(If instead of q or Escape you hit Enter or Return and then move the cursor, you will be selecting text to copy, and hitting Enter or Return a second time will copy it. Then you can paste with C-a followed by ].)

Of course, you can always use more and less, two commonly used pagers, which may be enough for some commands.

https://unix.stackexchange.com/questions/40242/scroll-inside-screen-or-pause-output

Press Ctrl-a then : and then type

scrollback 10000

to get a 10000 line buffer, for example.

You can also set the default number of scrollback lines by adding

defscrollback 10000

to your ~/.screenrc file.

To scroll (if your terminal doesn't allow you to by default), press Ctrl-a ESC and then scroll (with the usual Ctrl-f for next page or Ctrl-a for previous page, or just with your mouse wheel / two-fingers). To exit the scrolling mode, just press ESC.

Another tip: Ctrl-a i shows your current buffer setting.

https://stackoverflow.com/questions/8760346/how-do-i-increase-the-scrollback-buffer-in-a-running-screen-session

GNU Screen使用的更多相关文章

  1. 从Tmux 转到GNU Screen

    网上很多地方都说Tmux比GNU Screen要好用,不过无意间看到这篇Switching from tmux to GNU Screen之后,我发现GNU Screen的窗口/区域概念更好,至少是更 ...

  2. GNU Screen Usage

    分屏: 1.在终端输入screen命令 2.Ctrl+a 然后shift+s 上下分屏,切换到下方Ctrl+a tab然后新建一个window(Ctrl+a c) 3.切换到上方,Ctrl+a tab ...

  3. GNU Screen使用入门

    前些天开始学习使用GNU Screen程序,发现这个工具在管理服务器时候确实挺方便的,于是写一篇文章总结一下,顺便介绍Screen的基本使用方法. 简介 GNU Screen是 一个基于文本的全屏窗口 ...

  4. gnu screen的用法

    在使用ssh或者telnet登录远程主机后执行一些耗时的命令, 如果此时ssh或者telnet中断, 那么远程主机上正在执行的程序或者说命令也会被迫终止. screen能够很好地解决这个问题, scr ...

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

    你是不是经常需要 SSH 或者 telent 远程登录到 Linux 服务器?你是不是经常为一些长时间运行的任务而头疼,比如系统备份.ftp 传输等等.通常情况下我们都是为每一个这样的任务开一个远程终 ...

  6. linux screen 命令详解

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

  7. 源码编译安装screen

    OS:Amazon Linux AMI 2015.09.2 (HVM) #sudo su #wget http://ftp.gnu.org/gnu/screen/screen-4.3.1.tar.gz ...

  8. linux screen 命令详解[转]

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

  9. 使用 screen 管理你的远程会话

    文章转载自:https://www.ibm.com/developerworks/cn/linux/l-cn-screen/ 在此只作为笔记使用,不做他用 你是不是经常需要 SSH 或者 telent ...

随机推荐

  1. 细读jsr中的yield语义,或者不是我们想象中的那样

    这只是我的个人观点,如有错误,希望你可以指出. 首先英文原版 中文译版 我觉得“不需要”还会让人产生误解,应该译为不一定要. 很多时候会被断章取义地理解,我们一定要有“不一定”,“可能”的意识,下面给 ...

  2. 安全扫描工具Acunetix即AWVS_13.x系列破解版Linux & Windows

    本站所提供工具仅供技术学习交流.请勿用于非法行为.否则后果自负. Acunetix,自动化网络应用安全软件的先驱,已经宣布发布Acunetix第13版.新版本提供了一个改进的用户界面,并引入了创新,如 ...

  3. ASP .NET CORE 源码地址

    ASP .NET CORE 源码地址:https://github.com/dotnet/ 下拉可以查找相应的源码信息, 例如:查找 ASP .NET CORE Microsoft.Extension ...

  4. Android中通过数组资源文件xml与适配器两种方式给ListView列表视图设置数据源

    场景 实现效果如下 注: 博客: https://blog.csdn.net/badao_liumang_qizhi 关注公众号 霸道的程序猿 获取编程相关电子书.教程推送与免费下载. 实现 将布局改 ...

  5. MongoDB集群负载不均衡问题定位及解决

    1.问题描述 这是一套运行在腾讯云上的MongoDB 3.6版本集群,共5个分片,每片规格是6核16GB. 在压测的过程中,发现第3个分片的CPU使用率长时间高达96%,其它4个分片的CPU使用率都没 ...

  6. everspin最新1Gb容量扩大MRAM吸引力

    everspin提供了8/16-bit的DDR4-1333MT/s(667MHz)接口,但与较旧的基于DDR3的MRAM组件一样,时序上的差异使得其难以成为DRAM(动态随机存取器)的直接替代品.   ...

  7. Codeforces Round 450 D 隔板法+容斥

    题意: Count the number of distinct sequences a1, a2, ..., an (1 ≤ ai) consisting of positive integers ...

  8. spark基本概念整理

    app 基于spark的用户程序,包含了一个driver program和集群中多个executor driver和executor存在心跳机制确保存活3 --conf spark.executor. ...

  9. Eclipse中Git图标表示内容

    Eclipse中->属性->Team->Git->Label Decorations

  10. 没有正确配置扫描包,提示spring的bean不存在

    如下提示的解决方案: <!-- 扫描org.infor包下面的java文件,有Spring的相关注解的类,则把这些类注册为Spring的bean -->  <context:comp ...