Monday, January 30, 2012

Power of Proc-7: process exe file path

Another intresting entry in proc file system is "/proc/[pid]/exe"
this file shows to a binary file which the process or command
is associated with.

Lets see an example:
1. Chose crond process. Process id is 1379
cooltips# ps -eaf | grep cron

root  1379     1  0  2011 ? 0:00:07 crond


Here ps is showing only process name in the above output,
to look at the exact command which is being used to run
the process can be seen in step 2.


2. Run the following command to see what 'exe' file is pointing to.
cooltips# ls -l /proc/1379/exe
lrwxrwxrwx. 1 root root 0 Jan 30 10:17 /proc/1379/exe -> /usr/sbin/crond
The actual command used to run the process with pid '1379'
 is shown above i.e /usr/sbin/crond

Hoping  this 'power of proc' series will give some sort of useful
information about a process which can be useful for you during
debugging. 

Please leave your comments.
Pin It
Related Posts Plugin for WordPress, Blogger...