Skip to content
Advertisement

How to list running screen sessions?

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

  1. ssh to server XXX
  2. launch screen
  3. start experiments in a few tabs
  4. detach screen
  5. disconnect from the server

While the experiments are running, I can easily find on which servers they are by sshing to all servers and listing my running processes (using top or ps).

However, once the experiments are finished, how could I find on which servers I have a screen session opened (so that I can have a look at the output, relaunch them, etc.) ?

PS: my experiments do print their output to files, too… but this is not the point of my question.

Advertisement

Answer

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

JavaScript

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

JavaScript

I get this on my machine:

JavaScript

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

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement