Tutorial :Unix pipes question



Question:

I would like to know, if there is a way to print the pipes associated with a process, like "ipcs -s" for semaphores.


Solution:1

The closest thing that comes to mind is lsof -p <pid>|grep FIFO.


Solution:2

Yes, there is. Pipes are file handles, and anything that shows open filehandles (lsof, for instance) will show them.


Solution:3

Well, pipes are just open file descriptors in *nix, so you could ask it to print the open file descriptors for a specific process with:

lsof -p <process id>  

I don't know if there's a way to filter by pipe creation, though.


Solution:4

For completeness, if you're on Linux but don't have lsof installed, you can do:

ls -l /proc/<pid>/fd  

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »