See what process is using a file in Mac OS X

JPC picture JPC · Nov 29, 2011 · Viewed 77.1k times · Source

I would like to be able to track a file and see which process is touching that file. Is that possible? I know that I can see the list of open processes in activity monitor but I think it's happening to quickly for me to see it. The reason for this is I'm using a framework and I think the system version of the framework is being used instead of the debug version and I'd like to see which process is touching it.

Answer

spaceboy.cz picture spaceboy.cz · Nov 30, 2011

That's simple: sudo fs_usage | grep [path_to_file]