GNU Screen使用
基本使用
SSH时可以方便地resume工作
# open new screen session
screen
# restore
# -d: use the-doption 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
- Connect. Connect to a remote server and create a Screen session via
ssh -t <server.domain.name> screen -R- Detach. When done with the SSH session, use
ctrl-a dto detach from the session. This also disconnect with the SSH server.- 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 -Ragain to reconnect, then you are right where you left it.- 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
screenis 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-afollowed by].)Of course, you can always use
moreandless, 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
~/.screenrcfile.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.
GNU Screen使用的更多相关文章
- 从Tmux 转到GNU Screen
网上很多地方都说Tmux比GNU Screen要好用,不过无意间看到这篇Switching from tmux to GNU Screen之后,我发现GNU Screen的窗口/区域概念更好,至少是更 ...
- GNU Screen Usage
分屏: 1.在终端输入screen命令 2.Ctrl+a 然后shift+s 上下分屏,切换到下方Ctrl+a tab然后新建一个window(Ctrl+a c) 3.切换到上方,Ctrl+a tab ...
- GNU Screen使用入门
前些天开始学习使用GNU Screen程序,发现这个工具在管理服务器时候确实挺方便的,于是写一篇文章总结一下,顺便介绍Screen的基本使用方法. 简介 GNU Screen是 一个基于文本的全屏窗口 ...
- gnu screen的用法
在使用ssh或者telnet登录远程主机后执行一些耗时的命令, 如果此时ssh或者telnet中断, 那么远程主机上正在执行的程序或者说命令也会被迫终止. screen能够很好地解决这个问题, scr ...
- linux 技巧:使用 screen 管理你的远程会话
你是不是经常需要 SSH 或者 telent 远程登录到 Linux 服务器?你是不是经常为一些长时间运行的任务而头疼,比如系统备份.ftp 传输等等.通常情况下我们都是为每一个这样的任务开一个远程终 ...
- linux screen 命令详解
一.背景 系统管理员经常需要SSH 或者telent 远程登录到Linux 服务器,经常运行一些需要很长时间才能完成的任务,比如系统备份.ftp 传输等等.通常情况下我们都是为每一个这样的任务开一个远 ...
- 源码编译安装screen
OS:Amazon Linux AMI 2015.09.2 (HVM) #sudo su #wget http://ftp.gnu.org/gnu/screen/screen-4.3.1.tar.gz ...
- linux screen 命令详解[转]
一.背景 系统管理员经常需要SSH 或者telent 远程登录到Linux 服务器,经常运行一些需要很长时间才能完成的任务,比如系统备份.ftp 传输等等.通常情况下我们都是为每一个这样的任务开一个远 ...
- 使用 screen 管理你的远程会话
文章转载自:https://www.ibm.com/developerworks/cn/linux/l-cn-screen/ 在此只作为笔记使用,不做他用 你是不是经常需要 SSH 或者 telent ...
随机推荐
- cesium1.63.1api版本贴地贴模型量算工具效果(附源码下载)
前言 cesium 官网的api文档介绍地址cesium官网api,里面详细的介绍 cesium 各个类的介绍,还有就是在线例子:cesium 官网在线例子,这个也是学习 cesium 的好素材.不少 ...
- vuex学习详细解(主页目录
学习vuex过程中,通过 vue-cli命令来配置和使用vuex笔记整理 vue-cli中配置vuex流程和注意事项 vuex目录配置 vuex的states.js vuex的getters.js v ...
- 重构与动态为angularjs栏位赋值或获取值
先来看下面一段html: 这个ng-model名称带有一定的规律带有序号. 先来实现数据绑定,从数据取到数据后,为ng-model绑定相对应的值: var c = response.data $sco ...
- JS高阶编程技巧--惰性函数
在vue.react等框架大量应用之前,我们需要使用jQuery或者原生js来操作dom写代码,在用原生js进行事件绑定时,我们可以应用DOM2级绑定事件的方法,即:元素.addEventListen ...
- mysql必知必会--排序检索数据
排序数据 其实,检索出的数据并不是以纯粹的随机顺序显示的.如果不排 序,数据一般将以它在底层表中出现的顺序显示.这可以是数据最初 添加到表中的顺序.但是,如果数据后来进行过更新或删除,则此顺 序将会受 ...
- 小白的linux笔记3:对外联通——开通ssh和ftp和smb共享
1.SSH的开通.https://www.cnblogs.com/DiDiao-Liang/articles/8283686.html 安装:yum install sshd或yum install ...
- BloodHound可视化之域分析
一.简介 BloodHound是一款将域内信息可视化的单页的web应用程序,是一款在域内进行信息收集的免费工具: bloodhound通过图与线的形式,将域内用户.计算机.组.会话.ACL以及域内所有 ...
- element-ui 和ivew-ui的table导出export纯前端(可用)
一.element-ui 1.安装依赖Element组件库中的el-table表格导出需要的主要是两个依赖:(xlsx 和 file-saver) npm install --save xlsx fi ...
- 【EasyUI总结】EasyUI开发中遇到的坑
普遍: 1.easyui在书写键值对的时候要注意是否要加引号,在需要加引号的地方不加则无法渲染: datagrid数据网格: 1.datagrid默认请求方式是post,如果要使用分页功能pagina ...
- Fhq Treap [FhqTreap 学习笔记]
众所周知 Fhq Treap 是 fhq 神仙研究出来的平衡树- 具体实现 每个点实现一个 \(\text{rnd}\) 表示 rand 的值 为什么要 rand 呢 是为了保证树高为 \(\log ...