News for hackers. Stuff that matters.
Re:Unix Shells and the Current Directory by tyingq on Sunday November 26, 2023 @01:43PM (#38423857)
Where it exists, there's also /proc/self/cwd, so you can do: readlink -e /proc/self/cwd
Re:Unix Shells and the Current Directory by rezonant on Sunday November 26, 2023 @03:00PM (#38424467)
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).
Re:Unix Shells and the Current Directory by didntcheck on Sunday November 26, 2023 @03:31PM (#38424732)
ls -l also works. I often do

  ls -l /proc/`pidof foo`/fd
to see what files a taciturn process is working on
Re:Unix Shells and the Current Directory by bobbyi on Monday November 27, 2023 @12:03AM (#38428279)
lsof is also good for seeing what files a process is using https://www.thegeekstuff.com/2012/08/lsof-command-examples/