Tutorial :Unix pipes question


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


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


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


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.


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
Next Post »