Reputation: 73
I ran a command $./cpu-print > /tmp/tmp.txt &. Now I need to go to the proc folder of this process, and describe where its I/O file descriptors 0, 1, 2 are pointing to. How can I do this?
Upvotes: 1
Views: 752
Reputation: 8466
Maybe ls
from the /proc/<pid>/fd
directory contains the wanted information:
> ls -l /proc/`pidof cpu-print`/fd
lrwx------ 1 ccc ccc users 64 Mar 9 12:46 0 -> /dev/pts/2
l-wx------ 1 ccc ccc users 64 Mar 9 12:46 1 -> /tmp/tmp.txt
l-wx------ 1 ccc ccc users 64 Mar 9 12:46 2 -> /dev/null
lrwx------ 1 ccc ccc users 64 Mar 9 12:46 3 -> /dev/pts/2
Upvotes: 2