instead of lsof, fs_usage or ps use the DTrace based opensnoop
For example watch which files are touched by Safari when your browsing through the web with the -n switch for filtering process names: sudo opensnoop -n Safari
Or which process is accessing /etc/passwd? Use the -f switch for file based filtering: sudo opensnoop -f /etc/passwd
This handy script comes with every OS X since 10.5 Leopard.
Written by Oliver Leitzgen
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Terminal
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#