杀死独立屏幕会话

screen -X -S [session # you want to kill] kill
screen -ls

答案

$ screen -X -S [session # you want to kill] quit

通过执行以下操作,可以杀死在屏幕会话中没有响应的分离会话。

  1. 键入screen -list以标识分离的屏幕会话。

    ~$ screen -list  
        There are screens on:  
             20751.Melvin_Peter_V42  (Detached)

    注意: 20751.Melvin_Peter_V42是您的会话 ID。

  2. 附加到独立的屏幕会话

    screen -r 20751.Melvin_Peter_V42
  3. 连接到会话后,按Ctrl + A,然后输入:quit

screen -list
There is a screen on:
23536.pts-0.wdzee       (10/04/2012 08:40:45 AM)        (Detached)
1 Socket in /var/run/screen/S-root.
screen -S 23536 -X quit
//Creation:
screen -S some_name proc
// Kill detached session
screen -S some_name -X quit
screen -ls
There is a screen on:
         26727.pts-0.devxxx      (Attached)
 1 Socket in /tmp/uscreens/S-xxx. <------ this is where the session is.
screen -wipe
alias cleanscreen="screen -ls | tail -n +2 | head -n -2 | awk '{print $1}'| xargs -I{} screen -S {} -X quit"
exit
killd () {
for session in $(screen -ls | grep -o '[0-9]\{5\}')
do
screen -S "${session}" -X quit;
done
}
== ISSUE THIS COMMAND
[xxx@devxxx ~]$ screen -ls


== SCREEN RESPONDS
There are screens on:
        23487.pts-0.devxxx      (Detached)
        26727.pts-0.devxxx      (Attached)
2 Sockets in /tmp/uscreens/S-xxx.


== NOW KILL THE ONE YOU DONT WANT
[xxx@devxxx ~]$ screen -X -S 23487.pts-0.devxxx kill


== WANT PROOF?
[xxx@devxxx ~]$ screen -ls
There is a screen on:
        26727.pts-0.devxxx      (Attached)
1 Socket in /tmp/uscreens/S-xxx.