4

I use one daemon per project (so that when I open the client, they don't share buffers). I'd like to get a list of all the daemons that are running.

I tried using lsof -c emacs | grep "TYPE=STREAM" but that doesn't narrow it down sufficiently.

Is there a better way to go about it?

kshenoy
  • 211
  • 2
  • 11

1 Answers1

4

By default, on a Unix-like platform, the sockets are located in a directory called /tmp/emacs1234 where /tmp is the value of the environment variable TMPDIR (defaulting to /tmp) and 1234 is your user ID. So to list daemon sockets, assuming you aren't passing any argument to emacsclient other than the daemon name, just list the contents of that directory.

ls "${TMPDIR-/tmp}/emacs$(id -u)"

On many systems you can get away with just

ls /tmp/emacs$UID