Staff Member

You can get information about a PID, including its current working directory, by looking in the corresponding subdirectory in /proc. Each running PID has its own directory in /proc. Simply use the ls command to view the contents of /proc/$PID (where $PID is replaced with an actual valid PID).

PartnerNOC

Similarly and perhaps a bit more readable, you can get the cwd of a process using it's PID through lsof. It also will provide information about currently open (or listening) connections, sockets, and open files.