tags:

views:

161

answers:

4

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

+4  A: 

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

Daniel
+2  A: 

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.

Bob Somers
+2  A: 

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

chaos
+2  A: 

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

ls -l /proc/<pid>/fd
bdonlan
For linux, but not for arbitrary unixes...
dmckee
@dmckee, good point, fixed.
bdonlan