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

LinuxGnu Screen

Linux Problem Overview


I screen -r'd into a Django server that's running and I can't simply Ctrl + C and exit out of it.

Are there any alternative ways to get out of screen?

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

Linux Solutions


Solution 1 - Linux

Ctrl-a d or Ctrl-a Ctrl-d. See the screen manual # Detach.

Solution 2 - Linux

  • Ctrl + A, Ctrl + \ - Exit screen and terminate all programs in this screen. It is helpful, for example, if you need to close a tty connection.

  • Ctrl + D, D or - Ctrl + A, Ctrl + D - "minimize" screen and screen -r to restore it.

Solution 3 - Linux

  • Ctrl + A and then Ctrl+D. Doing this will detach you from the screen session which you can later resume by doing screen -r.

  • You can also do: Ctrl+A then type :. This will put you in screen command mode. Type the command detach to be detached from the running screen session.

Solution 4 - Linux

Ctrl+a followed by k will "kill" the current screen session.

Solution 5 - Linux

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

Ctrl + A and then K will only kill the current window in the current session, not the whole session. 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 + ".

Solution 6 - Linux

To terminate the screen session use

Ctrl + a followed by k

To detach session and restore later use

Ctrl + a followed by d

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionmeder omuralievView Question on Stackoverflow
Solution 1 - LinuxephemientView Answer on Stackoverflow
Solution 2 - LinuxfandyushinView Answer on Stackoverflow
Solution 3 - LinuxgsbabilView Answer on Stackoverflow
Solution 4 - Linuxuser674669View Answer on Stackoverflow
Solution 5 - LinuxNg Ju PingView Answer on Stackoverflow
Solution 6 - LinuxRKMView Answer on Stackoverflow