Skip to content

Instantly share code, notes, and snippets.

@JohannesHoppe
Created June 10, 2021 10:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohannesHoppe/91890618b56f90175c54a0c966f3e4ce to your computer and use it in GitHub Desktop.
Save JohannesHoppe/91890618b56f90175c54a0c966f3e4ce to your computer and use it in GitHub Desktop.
fix_spotlight.sh
#!/bin/sh
# Force rebuild the spotlight index from scratch.
# --> https://apple.stackexchange.com/a/74892
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment