问题描述
限时送ChatGPT账号..我正在尝试获取当前正在使用的 tmux 套接字列表,但迄今为止我提出的最佳解决方案是检查/tmp/tmux* 或 TMPDIR.
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.
据我所知 tmux 会将这些套接字保留一段时间,即使当前没有 tmux 会话正在使用它们.
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.
因此,我希望有类似于 tmux list-sessions 的东西,但是对于套接字,这会给我当前正在使用的所有套接字.我似乎无法在手册页中找到一个,如果有,我没有正确理解列出套接字是其目的.
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.
谢谢!
推荐答案
要列出 tmux
使用的所有套接字,您可以使用 lsof
:
To list all sockets used by tmux
you can use lsof
:
lsof -U | grep '^tmux'
如果查询者不拥有进程,请使用 sudo
.
Use sudo
if the inquirer doesn't own the process.
这篇关于是否可以找到当前正在使用的 tmux 套接字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论