Ubuntu – How to determine the path to a binary of a process

process

Is there a way to find out the directory/disk location a process was started from? I am aware of the /proc mount but not really where to look inside of it.

Best Answer

The /proc way would be to inspect the exe link in the directory corresponding to the pid.

Let's take an example with update-notifier:

Find the pid, which is 15421 in this example:

egil@gud:~$ ps x | grep update-notifier
 2405 pts/4    S+     0:00 grep update-notifier
15421 ?        Sl     0:00 update-notifier

Look up the symbolic link:

egil@gud:~$ file /proc/15421/exe
/proc/15421/exe: symbolic link to `/usr/bin/update-notifier'
Related Question