Viewing processes under Linux Everyone would have thought of using Ps-ef|grep XXX
But see not the whole path, how to see the whole path?
After each process starts, there is a path to the PID below the/proc
Example: Ps-ef|grep python
Display: Oracle 4431 4366 0 18:56 pts/2 00:00:00 python server.py
4431 is the process number
To/proc/4431, Ls-l will see (Requires root access):
Total dosage 0
-r--r--r--1 Oracle Oinstall 0 December 18:58 cmdline
lrwxrwxrwx 1 Oracle Oinstall 0 December 18:58 CWD--/XXX/ULTSERVER_AA
-R--------1 Oracle oinstall 0 December 18:58 environ
lrwxrwxrwx 1 Oracle oinstall 0 December 18:58 exe--/usr/bin/python2.4
DR-X------2 Oracle Oinstall 0 December 18:58 FD
-R--------1 Oracle Oinstall 0 December 18:58 Maps
-RW-------1 Oracle oinstall 0 December 18:58 Mem
-r--r--r--1 Oracle Oinstall 0 December 18:58 Mounts
lrwxrwxrwx 1 Oracle Oinstall 0 December 18:58 Root
-r--r--r--1 Oracle Oinstall 0 December 18:58 Stat
-r--r--r--1 Oracle Oinstall 0 December 18:58 STATM
-r--r--r--1 Oracle Oinstall 0 December 18:58 Status
Note CWD, which is the path to the process you are looking for.
Transferred from: http://blog.csdn.net/brioxu/article/details/5104736