Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I have multiple copies of the same app on the disk, and only one is running, as I can see with ps, how can I know the absolute path to distinguish from the others?

share|improve this question
up vote 39 down vote accepted
% sudo ls -l /proc/PID/exe


% ps -auxwe | grep 24466
root     24466  0.0  0.0   1476   280 ?        S     2009   0:00 supervise sshd
% sudo ls -l /proc/24466/exe
lrwxrwxrwx 1 root root 0 Feb  1 18:05 /proc/24466/exe -> /package/admin/daemontools-0.76/command/supervise
share|improve this answer
pwdx $pid

This gives you the Current Working Directory of the pid, not its absolute path. usually the which command will tell you which is being invoked from the shell.

#>which vlc
share|improve this answer
this answer need more upvote.. – Kokizzu Jan 30 '15 at 3:02

One way is ps -ef

share|improve this answer
didn't work for a specific service, it just provide the relative path – Jader Dias Feb 1 '10 at 16:57

The quick answer is to use ps with options or the /proc filesystem info. That will usually work, but is not guaranteed. In general, there is no definite, guaranteed answer. For instance, what if the executing file is deleted during execution, so that there is no path to the file?

See the Unix FAQ for a little more detail, particularly questions 4.3 and 4.4.

share|improve this answer
ps auxwwwe


share|improve this answer
does not show ALL full qualified paths on my linux: "root 24466 0.0 0.0 1476 280 ? S 2009 0:00 supervise sshd " for example – akira Feb 1 '10 at 17:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.