美文网首页
Linux(Ubuntu 18.04) screen

Linux(Ubuntu 18.04) screen

作者: LionPig | 来源:发表于2020-06-08 09:57 被阅读0次

什么是screen

Introduction to GNU Screen
Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. Each virtual terminal provides the functions of the DEC VT100 terminal and, in addition, several control functions from the ANSI X3.64 (ISO 6429) and ISO 2022 standards (e.g., insert/delete line and support for multiple character sets). There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows the user to move text regions between windows. When screen is called, it creates a single window with a shell in it (or the specified command) and then gets out of your way so that you can use the program as you normally would. Then, at any time, you can create new (full-screen) windows with other programs in them (including more shells), kill the current window, view a list of the active windows, turn output logging on and off, copy text between windows, view the scrollback history, switch between windows, etc. All windows run their programs completely independent of each other. Programs continue to run when their window is currently not visible and even when the whole screen session is detached from the users terminal.

screen是一个全屏窗口管理器,它在多个进程(通常是交互式外壳程序)之间多路复用物理终端。每个虚拟终端都提供DEC VT100终端的功能,此外,还提供ANSI X3.64(ISO 6429)和ISO 2022标准的几种控制功能(例如,插入/删除行和对多个字符集的支持)。每个虚拟终端都有一个回滚历史记录缓冲区,以及一个允许用户在窗口之间移动文本区域的复制粘贴机制。调用screen时,它将创建一个带有外壳的单个窗口(或指定的命令),然后不碍事,以便您可以正常使用该程序。然后,您可以随时创建包含其他程序(包括更多外壳程序)的新(全屏)窗口,取消当前窗口,查看活动窗口的列表,打开和关闭输出日志记录,在窗口之间复制文本,查看回滚历史记录,在窗口之间切换等。所有窗口都完全独立地运行其程序。当程序的窗口当前不可见时,甚至整个屏幕会话都与用户终端分离时,程序仍将继续运行。

简单来说,就是可以让一个Terminal进程在后台运行,即使你关掉这个Terminal窗口

安装

sudo apt install screen

基本使用

  • 查看screen列表 screen -ls
  • 创建 screen -S <Name>
  • 离开screen (进程未结束)
//在screen内
screen -d
//在screen外
screen -d <Name>
  • 再次唤醒进入某个screenscreen -r <Name>
  • 退出screen(screen内)(进程结束)exit
  • kill一个screen(不用进入screen) screen -S <Name> -X quit

相关文章

网友评论

      本文标题:Linux(Ubuntu 18.04) screen

      本文链接:https://www.haomeiwen.com/subject/dvaktktx.html