Showing posts with label current working directory. Show all posts
Showing posts with label current working directory. Show all posts

Friday, 18 October 2013

Finding the CWD (current working directory) of a running process

Luckily, due to the UNIX philosophy of "everything" is a file, makes it rather trivial to find what the current working directory is. You just need to look at the symbolic "cwd" link under the process directory:

# ls -al /proc/[process number here]/cwd lrwxrwxrwx 1 build build 0 Oct 18 12:29 /proc/2506/cwd /root/run