I have a process running in the background, a python one, with ps -ef
I can see filename from running command : UID PID PPID ... python ./filename.py
How can I know where the file is located
Advertisement
Answer
pwdx < PID > gives full directory the process is running from.
So, the full script would be
ps -ef | grep 'your process' | awk '{print $2}' | xargs pwdx
Though, you can simplify this into
pgrep 'your process' | awk '{print $1}' | xargs pwdx