Source From Here
Question
In Windows environment there is an API to obtain the path which is running a process. Is there something similar in Unix / Linux? Or is there some other way to do that in these environments?
How-To
If you want the path of the current executable, look at /proc/$PID/exe, which is a symlink to it. For example:
Question
In Windows environment there is an API to obtain the path which is running a process. Is there something similar in Unix / Linux? Or is there some other way to do that in these environments?
How-To
If you want the path of the current executable, look at /proc/$PID/exe, which is a symlink to it. For example: