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.
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.
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.
thanks for posting this command,
ReplyDeletehelped me lot