Created
December 27, 2012 03:27
-
-
Save anjerodesu/4385230 to your computer and use it in GitHub Desktop.
This is a Spotlight reindexing script for Mac. If you have problems such as your Mac is always indexing your HDDs or the indexing process always crashes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This is a Spotlight reindexing script for Mac. | |
# If you have problems such as your Mac is always indexing your HDDs | |
# or the indexing process always crashes. | |
# turn off all mounted volumes | |
# remove -a to apply only on current volume | |
# -a : apply command to all volumes | |
sudo mdutil -a -i off | |
# remove all indexed files | |
sudo rm -rfv /.Spotlight-V100 | |
# turn the spotlight back on with all mounted volumes | |
sudo mdutil -a -i on | |
# reindex all mounted volumes | |
sudo mdutil -aE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment