Ubuntu – kill a screen session

gnu-screen

I'm trying to kill a screen session. I noticed a lot of other related questions, but none of those answers are working for me. I am trying to kill the following session:

screen -ls
There is a screen on:
    23520.pts-6.porkypig    (09/30/2013 02:49:47 PM)    (Detached)
1 Socket in /var/run/screen/S-root.

screen -r 23520.pts-6.porkypig

Now I am in the session. According to the documentation:

http://www.gnu.org/software/screen/manual/screen.html#Quit

I am supposed to press "control a" and then "control \". I do that and nothing happens.

Another solution said to press Ctrl+a and type :quit. However, again it doesn't do anything. In fact, pressing control+a, absolutely nothing happens afterwards except a message "No Other Window"

Best Answer

first you need to re attach to the screen session
screen -r 23520 as you have done. Then press ctrl + a and then a k and press y when it asks if you really want to kill the session

Source