Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How could I find out what is the path to the binary file from a process? Like:

[usern@hostn ~]$ ps aux | grep -i gnome-session
gbor      2844  0.0  0.2  38072  7152 ?        Ssl  05:53   0:00 gnome-session
[usern@hostn ~]$ lsof | grep -i gnome-session
gnome-ses  2844      gbor  txt       REG      253,1   252592     792784 /usr/bin/gnome-session
[usern@hostn ~]$ 

Without using "lsof"

share|improve this question

1 Answer 1

up vote 3 down vote accepted

/proc/<PID>/exe is a symlink to the process's executable.

share|improve this answer
    
Pointing out readlink /proc/<PID>/exe before anyone tries to parse the hell out of ls output. –  grawity May 6 '11 at 12:21

Your Answer

 
discard

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.