$ pwdx -h

Usage:
 pwdx [options] pid...

Options:
 -h, --help     display this help and exit
 -V, --version  output version information and exit

For more details see pwdx(1).

프로세스 실행경로를 /proc/[PID]/exe 를 통해 찾아볼 수도 있지만 pwdx 를 이용하면 더 간편하다.

$ ps -aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   2456  1596 hvc0     Sl+  23:24   0:00 /init
root         4  0.0  0.0   2472   196 hvc0     Sl+  23:24   0:00 plan9 --control-socket 5 --log-level 4 --server-fd 6 --
root         8  0.0  0.0   2460   112 ?        Ss   23:25   0:00 /init
root         9  0.0  0.0   2476   116 ?        S    23:25   0:00 /init
xxx         10  0.0  0.0  10044  5004 pts/0    Ss   23:25   0:00 -bash
xxx         96  0.0  0.0  10860  3428 pts/0    R+   23:27   0:00 ps -aux
$ pwdx 10
10: /home/xxx

ps 로 PID 를 알아낸 다음 pwdx [PID] 를 입력하면 실행경로가 보인다. 권한이 필요한 경우 sudo pwdx [PID] 같은 식으로 입력하면 된다.

728x90

+ Recent posts