Gnu-Screen

使用螢幕有什麼好處?

  • August 10, 2010

man screen:

  Screen is a full-screen window manager that multiplexes a physical ter‐
  minal between several processes (typically interactive  shells).   Each
  virtual terminal provides the functions of a DEC VT100 terminal and, in
  addition, several control functions from the ISO 6429  (ECMA  48,  ANSI
  X3.64)  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 moving
  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 existing windows, view a list of windows, turn  out‐
  put  logging  on and off, copy-and-paste text between windows, view the
  scrollback history, switch between windows in whatever manner you wish,
  etc.  All  windows  run  their  programs completely independent of each
  other. Programs continue to run when their window is currently not vis‐
  ible and even when the whole screen session is detached from the user's
  terminal.  When a program terminates, screen (per  default)  kills  the
  window  that  contained  it.  If this window was in the foreground, the
  display switches to the previous  window;  if  none  are  left,  screen
  exits.

有了技術解釋,它與在正常 gnome 終端中創建選項卡有何不同?

對於您可以從手冊中執行的操作列表,我已經可以創建新選項卡、終止選項卡、查看我的選項卡列表、在視窗之間切換。只是螢幕更方便嗎?有人可以通俗地解釋一下好處嗎?

在您 C&P 的手冊頁中:

Programs continue to run when their window is currently not visible and
even when the whole screen session is detached from the user's terminal.

簡而言之,當您的網際網路連接中斷時,您screen的程序會繼續執行,並且當您重新登錄時,您可以重新連接到該會話。

在其他可能有用的時候是你會使用的時候nohup,例如執行一個可以中斷網路連接幾秒鐘的腳本(讓你的會話終止並且你的腳本離開SIGHUP可能會讓你的機器脫離網路)。

我不知道有多少人使用螢幕的“螢幕管理”功能,但我知道很多人在註銷後分離程序以保持它們執行。

引用自:https://serverfault.com/questions/168932