1.找到运行程序的PID
# ps aux | grep redisroot pts/ S+ : : grep redisroot ? Ssl Aug30 : redis-server *:# ps aux | grep redisroot pts/ S+ : : grep redisroot ? Ssl Aug30 : redis-server *:#
不管用ps也好,top也罢,只要能够找到运行程序的PID,例如,上面redis的pid为1782
2.找到程序的路径
# /exelrwxrwxrwx. root root 8月 : /proc//exe -> /usr/local/bin/redis-server
根据PID则可以在/proc/PID/exe 找到程序所在的目录