Skip to content

Instantly share code, notes, and snippets.

@justincase
Last active December 20, 2015 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justincase/6054172 to your computer and use it in GitHub Desktop.
Save justincase/6054172 to your computer and use it in GitHub Desktop.
Spying on Spotlight with fs_usage. http://superuser.com/a/46381

To see what mds and more importantly its child mdworker is actually doing - use fs_usage to log what files it is opening:

sudo fs_usage -w -f filesys mdworker

Though there is a lot of unintelligable stuff in there, it does tell you when it opens a file to begin reading from it. Copying a PDF into my filesystem shows mdworker opening the file then immediately after lots of activity...

p.s. if you want a little less detail, this will just list the open file points:

sudo fs_usage -w -f filesys mdworker | egrep "open"

--The Tentacle
http://superuser.com/a/46381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment