Rebuild the Spotlight index on Mac

Erase the broken Spotlight database so macOS re-indexes your drive from scratch.

macOSTerminalDiagnosticsMedium risk
Run the command below and enter your password — Spotlight wipes its index for the system drive and starts rebuilding immediately.

01Command

Command
$ sudo mdutil -E /

02What it does

When Spotlight misses files, shows stale results, or nothing appears at all, its index store is usually corrupt. mdutil -E erases the index for the root volume; the system notices the empty store and re-crawls every indexed folder automatically. Check progress with mdutil -s / (it reports "Indexing enabled" while the crawl runs). No reboot is required.

03Risk

RiskMedium risk
RequirementsAdministrator password (sudo).
CompatibilitymacOS 10.11 El Capitan – 15 Sequoia
!Warning: While the rebuild runs — typically minutes to a couple of hours for large drives — Spotlight search will be incomplete and CPU/battery usage rises.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • macOS mdutil command reference
    SS64 · technical · 2026-09-16
    Evidence: mdutil -E erases and rebuilds the Spotlight index store for the specified volume or directory.

Last verified: 2026-09-16 · Category: System & Settings

06Related solutions