Hacker News new | past | comments | ask | show | jobs | submit login

Where it exists, there's also /proc/self/cwd, so you can do: readlink -e /proc/self/cwd



While readlink is the correct way to just read the link, I often just use `file ...` since it will also show the symbolic link destination (on GNU at least).


ls -l also works. I often do

  ls -l /proc/`pidof foo`/fd
to see what files a taciturn process is working on


lsof is also good for seeing what files a process is using https://www.thegeekstuff.com/2012/08/lsof-command-examples/




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: