terminal command to show what Spotlight is indexing?

Is there any terminal command to show what specific files Spotlight is indexing at the very moment? Since Mavericks I have the problem that Spotlight reindexes for some minutes after every start of my Mac and slows down the system. I would like to know which files are in concern.

Posted on Jul 6, 2014 10:54 PM

Reply
18 replies

Jul 7, 2014 10:38 AM in response to Steffen Bendix

Take a look at System Preferences > Spotlight. Every category that you have checked will get indexed. If you have additional internal or external drives connected, these will get indexed — unless you added them to System Preferences > Spotlight > Privacy. My external Time Machine drive is in there.


Other than opensnoop, real-time viewing of the mdworker sub-process is not provided — probably for a practical reason.

Jul 9, 2014 1:05 AM in response to dwbrecovery

Yes, I did all that with the help of Apple support on the phone. I put all cache files into the trash, made a reboot, deleted them, made a reboot. Made a safe restart. Deleted caches. Disabled Spotlight at all and reenabled it again. Put the whole hard drive into the privacy tab. This mdutil thingy. Nothing helped. Because this issue occurs on three different computers with different setups since the upgrade to Mavericks, I assume this is caused by the system itself. Spotlight is not only indexing the Applications folder but several other locations, too. It is difficult to investigate. That's why I asked for an appropriate terminal command in my initial post.


I can see in Activity Monitor that the IconServiceAgent causes a lot hard drive activity as well. This and Spotlight make every startup chewy.

Jul 11, 2014 1:30 AM in response to Steffen Bendix

Could this be the reason? Disk Utility always reports wrong permissions on System/Library/Spotlight/CoreMedia.mdimporter, no matter how often I run the routine. It always reports a successful repair, which is wrong. This is the output:


Der Benutzer unterscheidet sich auf „System/Library/Spotlight/CoreMedia.mdimporter“, korrekt wäre 0, Benutzer ist jedoch 501.Gruppe unterscheidet sich auf „System/Library/Spotlight/CoreMedia.mdimporter“, korrekt wäre 0, Gruppe ist jedoch 20.„System/Library/Spotlight/CoreMedia.mdimporter“ wurde repariert

Jul 11, 2014 4:25 AM in response to Steffen Bendix

That certainly could be an issue.

You can fix it with Terminal. Copy/paste in this command into Terminal while logged in as an admin user:

sudo chown 0:0 /System/Library/Spotlight/CoreMedia.mdimporter

It will ask for your password. Enter it, but note that you will not see anything repeated back on the screen. Just type the password and hit return.


That will change the owner and group to the appropriate values. For some reason. It has the first user set up as owner.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

terminal command to show what Spotlight is indexing?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.