What command(s) can one use to find out the current working directory (CWD) of a running process? These would be commands you could use externally from the process.
shell – How to Find Current Working Directory of a Running Process
command linecwdprocessshell
Best Answer
There are 3 methods that I'm aware of:
pwdx
lsof
/proc
Examples
Say we have this process.
Then if we use
pwdx
:Or you can use
lsof
:Or you can poke directly into the
/proc
: