How to see what files spotlight is currently indexing

Spotlight has been driving me nuts, over working my poor Harddrive so that my whole computer goes to a crawl. (CPU usage is still pretty low, then again I do have a core i7).

I saw somewhere that there was a way to see what it was currently indexing but I don't remember where.

Any ideas as to see what it's indexing?

I want to see if it's some files that keep doing it, then just put that folder in the ignore list.


Solution 1:

Have you tried

sudo opensnoop -p PID

where PID is the process ID of mdworker?

Solution 2:

You can use the fs_usage command to see the list of files visited by the mdworker process:

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

Hope it helps!