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

a1a*_*1an 5 linux diagnostics pipe named-pipes

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

就像是:

lspipes -l -p pid
Run Code Online (Sandbox Code Playgroud)

导致类似于:

[rw]  descriptor  size  name
Run Code Online (Sandbox Code Playgroud)

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

或类似的东西

Pra*_*ran 11

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]
Run Code Online (Sandbox Code Playgroud)

2) lsof | grep 57731

wineserve 3641 prabagaran   76w     FIFO        0,8       0t0   57731 pipe
winedevic 3651 prabagaran   16r     FIFO        0,8       0t0   57731 pipe
Run Code Online (Sandbox Code Playgroud)

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