微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

linux – 如何使用bash命令列出进程使用的管道

有没有办法列出正在运行的linux进程使用的管道(例如,给定它的pid或进程名称)并确定它们的已用容量?

就像是:

lspipes -l -p pid

导致类似于:

[rw]  descriptor  size  name

其中rw是管端类型,大小是其使用容量

或类似的东西

最佳答案
1)ls -l / proc / pid / fd

这将列出管道

lr-x------ 1 prabagaran prabagaran 64 Sep  5 23:01 14 -> pipe:[57729]
l-wx------ 1 prabagaran prabagaran 64 Sep  5 23:01 15 -> pipe:[57728]
lr-x------ 1 prabagaran prabagaran 64 Sep  5 23:01 16 -> pipe:[57731]
lr-x------ 1 prabagaran prabagaran 64 Sep  5 23:01 17 -> pipe:[57730]

2)lsof | grep 57731

wineserve 3641 prabagaran   76w     FIFO        0,8       0t0   57731 pipe
winedevic 3651 prabagaran   16r     FIFO        0,8       0t0   57731 pipe

这些是与给定进程ID相关的管道信息.

原文地址:https://www.jb51.cc/linux/440362.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐