Skip to content

Instantly share code, notes, and snippets.

@adamstac
Last active November 4, 2025 23:35
Show Gist options
  • Select an option

  • Save adamstac/1249295 to your computer and use it in GitHub Desktop.

Select an option

Save adamstac/1249295 to your computer and use it in GitHub Desktop.

Disable:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

Enable:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

Commands

Disable the index:

mdutil -i off /

Enable the index:

mdutil -i on /

Erase the current Spotlight index:

mdutil -E /

Help

Usage: mdutil -pEsa -i (on|off) -d volume ...
	Utility to manage Spotlight indexes.
	-p             Publish metadata.
	-i (on|off)    Turn indexing on or off.
	-d             Disable Spotlight activity for volume (re-enable using -i on).
	-E             Erase and rebuild index.
	-s             Print indexing status.
	-a             Apply command to all volumes.
	-V vol         Apply command to all stores on the specified volume.
	-v             Display verbose information.
NOTE: Run as owner for network homes, otherwise run as root.

Sources:

@smktpd
Copy link

smktpd commented Nov 4, 2025

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Unload failed: 5: Input/output error
Try running launchctl bootout as root for richer errors.

@smktpd
Copy link

smktpd commented Nov 4, 2025

sudo mdutil -a -i off is better than sudo mdutil -i off / as it will disable all indexing.
However, you didn't mention that it does so TEMPORARILY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment