I had a hard time getting Activity Monitor to show open files for a process that was running as root (via sudo). The original question mentions lsof
, and it does the trick exactly. If you know the process name or PID, it’s super quick.
Find processes by name:
lsof -c processname
Find processes by PID:
lsof -p 123
(Prefix with sudo
as needed, such as if you are not the owner of the process.)