How do I get the path of a process in Unix / Linux

后端 未结 11 650
无人共我
无人共我 2020-12-02 04:31

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 th

11条回答
  •  广开言路
    2020-12-02 04:59

    On Linux, the symlink /proc//exe has the path of the executable. Use the command readlink -f /proc//exe to get the value.

    On AIX, this file does not exist. You could compare cksum and cksum /proc//object/a.out.

提交回复
热议问题