Reputation: 1892
Say, hypothetically, I start a process in the background and redirect its stdout
and stderr
to an arbitrary file somewhere. Months later, the process is still running and I've forgotten where that file is. If I know the process's ID how can I programatically determine the location to where it's sending its output?
Upvotes: 1
Views: 2139
Reputation: 88959
With Linux, you can run:
ls -l /proc/PROCESS_ID/fd/1 /proc/PROCESS_ID/fd/2
Upvotes: 4