16

What is the reason that /proc does not exist in OS X? I was curious to find file descriptors that a process was using in my Mac. The way I do it in linux is to go in /proc/fd folder of that process.

How do I find what fds are used by a process?

1 Answer 1

14

Going back to basics : Ubuntu is a GNU/Linux, OS X is a FreeBSD : Different systems, different way to work.

On OS X you can use lsof to see the open files.

$lsof -p 68180

would show you every files opened by the process with pid 68180.

4
  • 11
    This post doesn't really answer the question. It states that the reson is FreeBSD, but FreeBSD does have /proc Jul 13, 2015 at 17:00
  • 7
    it does not answer the question. E.g. /proc/cpuinfo or /proc/meminfo - these have nothing to do with lsof. Aug 19, 2015 at 21:07
  • 2
    macOS isn't based off of FreeBSD, but rather a mixture of BSD and FreeBSD. This chart may be of use.
    – JMY1000
    Feb 21, 2017 at 10:46
  • If you need /proc for machine processing, lsof -F produces machine readable output. See the man pages for its spec. (man lsof on your command line)
    – Eonil
    Jul 13, 2020 at 2:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .