Skip to content

Instantly share code, notes, and snippets.

@ssaadh
Last active May 3, 2017 03:35
Show Gist options
  • Save ssaadh/31c5729726a1f28b500c4d501d1879d2 to your computer and use it in GitHub Desktop.
Save ssaadh/31c5729726a1f28b500c4d501d1879d2 to your computer and use it in GitHub Desktop.
Spotlight Rebuilding Ugh!
#!/bin/sh
# Turn off spotlight.
sudo mdutil -a -i off
# Remove the index files.
sudo rm -rfv /.Spotlight-V100
# Turn on spotlight.
sudo mdutil -a -i on
# Reindex all mounted /Volumes
sudo mdutil -aE
# if above doesn't work like it didn't work for me
sudo mdutil -i on /Volumes/*
# Disable Spotlight
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
# Enable Spotlight
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment