是否可以找到当前正在使用的 tmux 套接字?

编程入门 行业动态 更新时间:2024-10-27 14:18:57
本文介绍了是否可以找到当前正在使用的 tmux 套接字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送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:关键词]

本文发布于:2023-04-30 05:10:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1390088.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可以找到   tmux

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!