Get list of open files (descriptors) in OS X

前端 未结 8 1283
难免孤独
难免孤独 2020-12-05 01:28

I would like to get a list of open files in a process on os x (10.9.1). In Linux I was able to get this from /proc/PID/fd. However I\'m not sure how to get the

8条回答
  •  心在旅途
    2020-12-05 02:21

    "You can get the list of open files by process via the default activity monitor application. Just double click on the relevant process on the list and select "Open Files and Ports" tab on the popup." But "you had a hard time getting Activity Monitor to show open files for a process that was running as root (via sudo) or others user".

    So just run Active Monitor by sudo, that`s it

    sudo /Applications/Utilities/Activity\ Monitor.app/Contents/MacOS/Activity\ Monitor
    

提交回复
热议问题