Linux 如何在不输入“退出”的情况下退出屏幕?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4847691/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 00:14:32  来源:igfitidea点击:

How do I get out of a screen without typing 'exit'?

linuxgnu-screen

提问by meder omuraliev

I screen -r'd into a django server that's running and I can't simply Ctrl-Cand exitout of it.

screen -r“d成的运行Django的服务器,我不能简单地Ctrl-Cexit出来。

Are there any alternative ways to get out of screen?

有没有其他方法可以摆脱screen

Currently, I manually close the tab on my local PC and sshback in, but that's becoming tiresome.

目前,我手动关闭本地 PC 上的选项卡并ssh重新打开,但这变得很烦人。

采纳答案by ephemient

Ctrl-ador Ctrl-aCtrl-d. See the screen manual # Detach.

Ctrl-adCtrl-aCtrl-d。请参阅屏幕手册 # Detach

回答by gsbabil

  • Ctrl+Athen Ctrl+D. Doing this will detach you from the screensession which you can later resume by doing screen -r.

  • You can also do: Ctrl+Athen type :, this will put you in screen command mode. Type the command detachto be detached from the running screen session.

  • Ctrl+A然后Ctrl+ D。这样做将使您与screen会话分离,您可以稍后通过执行 来恢复会话screen -r

  • 您还可以执行以下操作:Ctrl+A然后键入:,这将使您进入屏幕命令模式。键入detach要从正在运行的屏幕会话中分离的命令。

回答by fandyushin

  • Ctrl-a+Ctrl-\- Exit screen and terminate all programs in this screen. Helpful, for example, if you need to close tty connection.
  • Ctrl-a+dor - Ctrl-a+Ctrl-d- "minimize" screen, screen -rto restore it.
  • Ctrl-a+ Ctrl-\- 退出屏幕并终止此屏幕中的所有程序。有用,例如,如果您需要关闭 tty 连接。
  • Ctrl-a+d或 - Ctrl-a+ Ctrl-d- “最小化”屏幕,screen -r以恢复它。

回答by user674669

Ctrl+afollowed by kwill "kill" the current screen session.

Ctrl+a后跟k将“杀死”当前屏幕会话。

回答by Ng Ju Ping

In addition to the answers above, you can also do Ctrl+A, then enter colon(:), and you will notice a little input box at the bottom left. Type 'quit' and press ENTERto leave the current screen session. Note that this will REMOVEyour screen session.

除了上面的答案,你也可以按Ctrl+A,然后输入冒号(:),你会注意到左下角有个小输入框。输入“退出”并按ENTER离开当前屏幕会话。请注意,这将删除您的屏幕会话。

Ctrl+a then k will only kill the current WINDOWin the current SESSION, not the WHOLEsession. A screen session consists of windows, which can be created using subsequent Ctrl+A followed by c. These windows can be viewed in a list using Ctrl + A + ".

按Ctrl + A则k只会杀死当前窗口在当前的SESSION,而不是会话。屏幕会话由窗口组成,可以使用后续的 Ctrl+A 和 c 创建这些窗口。可以使用 Ctrl + A + " 在列表中查看这些窗口。