Is it possible to find tmux sockets currently in use?

爷,独闯天下 提交于 2019-12-21 06:58:32

问题


I am trying to get a list of tmux sockets that are currently being used but the best solution I've come up with so far is to check in /tmp/tmux* or TMPDIR.

As far as I can tell tmux keeps these sockets around for some amount of time even if no current tmux session is using them.

As such I was hoping there was something similar to tmux list-sessions, but for sockets, that would give me all the sockets that are currently being used. I couldn't seem to find one in the man page and if there was one I didn't properly understand that listing sockets was its purpose.

Thanks!


回答1:


To list all sockets used by tmux you can use lsof:

lsof -U | grep '^tmux'

Use sudo if the inquirer doesn't own the process.




回答2:


Assuming that the tmux sockets are located at /tmp, which is where they wil be by default, To list all the sockets,

lsof | grep tmp/tmux



来源:https://stackoverflow.com/questions/11333291/is-it-possible-to-find-tmux-sockets-currently-in-use

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!