Kill all detached screen sessions

前端 未结 6 1717
时光取名叫无心
时光取名叫无心 2021-01-29 20:47

When I execute screen -ls, I see the following. How can I kill all the detached sessions?

There are screens on:

    84918.tty         


        
6条回答
  •  故里飘歌
    2021-01-29 21:26

    '[0-9]\{3,\}'
    

    in case of

    There is a screen on:
    20505.blabla    (03/05/2014 22:16:25)   (Detached)
    1 Socket in /var/run/screen/S-blabla.
    

    will match both 20505 and 2014, where quitting 2014 will return "No screen session found."

    [0-9]\{3,\}\.\S*
    

    might work.

    I've always encountered pattern 20505.name, where name is either host name or session name if screen was launched with -S flag. Works on OS X and Debian, might not be universal.

提交回复
热议问题