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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.