Find Working Directory Of Some Process In Linux
If i found that any particular process is causing load while monitoring your Linux server, i would kill the process to get rid of it. Now, i found it is always better to identify the root cause of problem. Find out from which directory this process is running.
Then i know that it is very easy to identify the working directory of the process, first of all find out the ID of the process for which you wish to determine the working directory. Run the following comamnd :
ps -ef | grep Process-Name
where replace Process-Name with the name of the process, just like if you want to find out the process ID for firefox then run the command as:
ps -ef | gep firefox
Once you have determined the process ID, run the following command to find out its working directory.
pwdx processID
That’s it, Enjoy!
If i found that any particular process is causing load while monitoring your Linux server, i would kill the process to get rid of it. Now, i found it is always better to identify the root cause of problem. Find out from which directory this process is running.
Then i know that it is very easy to identify the working directory of the process, first of all find out the ID of the process for which you wish to determine the working directory. Run the following comamnd :
ps -ef | grep Process-Name
where replace Process-Name with the name of the process, just like if you want to find out the process ID for firefox then run the command as:
ps -ef | gep firefox
Once you have determined the process ID, run the following command to find out its working directory.
pwdx processID
That’s it, Enjoy!