是否可以找到当前正在使用的 tmux 套接字? [英] Is it possible to find tmux sockets currently in use?

查看:29
本文介绍了是否可以找到当前正在使用的 tmux 套接字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取当前正在使用的 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆