How to find out from which folder a process is running?
Try this:
ls -l /proc/<PID>/cwd
Derived rom HUB's answer:
readlink /proc/<PID>/cwd
or even
readlink /proc/$(pgrep <program_name>)/cwd
You can't tell where a process was invoked from, only where it currently is. Look at the cwd
("current working directory") link instead of exe
.