gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 01:06:17 25 4
gpt4 key购买 nike

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

类似于:

lspipes -l -p pid

结果是这样的:

[rw]  descriptor  size  name

其中rw是管端类型,size是它的使用容量

或者类似的东西

最佳答案

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 相关的管道信息。

关于linux - 如何使用 bash 命令列出进程使用的管道,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12283698/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com