How to list running screen sessions?

后端 未结 9 1316
执笔经年
执笔经年 2020-12-12 10:10

I have a bunch of servers, on which I run experiments using screen. The procedure is the following :

  1. ssh to server XXX
  2. launc
9条回答
  •  温柔的废话
    2020-12-12 10:44

    To list all of the screen sessions for a user, run the following command as that user:

    screen -ls
    

    To see all screen sessions on a specific machine you can do:

    ls -laR /var/run/screen/
    

    I get this on my machine:

    gentle ~ # ls -laR /var/run/screen/
    
    /var/run/screen/:
    total 1
    drwxrwxr-x  4 root utmp   96 Mar  1  2005 .
    drwxr-xr-x 10 root root  840 Feb  1 03:10 ..
    drwx------  2 josh users  88 Jan 13 11:33 S-josh
    drwx------  2 root root   48 Feb 11 10:50 S-root
    
    /var/run/screen/S-josh:
    total 0
    drwx------ 2 josh users 88 Jan 13 11:33 .
    drwxrwxr-x 4 root utmp  96 Mar  1  2005 ..
    prwx------ 1 josh users  0 Feb 11 10:41 12931.pts-0.gentle
    
    /var/run/screen/S-root:
    total 0
    drwx------ 2 root root 48 Feb 11 10:50 .
    drwxrwxr-x 4 root utmp 96 Mar  1  2005 ..
    

    This is a rather brilliantly Unixy use of Unix Sockets wrapped in filesystem permissions to handle security, state, and streams.

提交回复
热议问题