Tuesday, September 6, 2011
1:59 PM

Working directory of a process

If you want to find from which directory was a process launched or which directory is a process running from you can use the command "pwdx"
It takes as input the process id of the process of which you want to find the directory.

You will have to run the command as root. 


For eg:

$ sudo  pwdx 1 


The pid one belongs to "init"  and it is run from the root directory "/" .
You can use the command "ps -ef"  or "pidof"  to find the pid of the process you are interested in.

0 comments:

Post a Comment