Re-Index Spotlight from the Terminal, Re-Gain Valuable Time for Life [OS X Tips]

Re-Index Spotlight from the Terminal, Re-Gain Valuable Time for Life [OS X Tips]

Last week, we showed you how to make Spotlight work faster with a little reindexing trick in System Preferences. Today, we’ll do the same thing, only we’ll use some Terminal magic to make it happen.

As we mentioned then, sometimes the indexing database that Spotlight uses to keep track of where your files are gets corrupted, misplaced, or left on an old hard drive somewhere. Whatever the reason, though, we’re assuming you need to manually re-update. Here’s how.

Launch Terminal, and type or paste the following command:

sudo mdutil -E /

This basically asks for temporary super user status, which is why Terminal may ask you for your password (it may not if you’ve used a sudo command recently or are already logged in as a super user or root. The command asks the unix tool mdutil to reindex the spotlight database for everything on the computer, including external drives, mounted disk images, etc. To re-index only for a specific drive, use the /Volumes path. For example, for an external drive named “MiniMe,” the command would look like this:

sudo mdutil -E /Volumes/MiniMe/

Spotlight will begin to re-index on the spot, so things might get a bit slower, especially if you are using an older Mac and re-indexing the entire filesystem.

[image source: HD Wallpaper]

  • clyde

    I did on my mac but since then it has become painfully slow. Everything is just too slow for 3 days now. I can’t even clean up trash, Finder takes 2 minutes to load, Xcode launches at least 5 minutes and Chrome just keeps on hanging. Is this normal?

About the author

Rob LeFebvreAnchorage, Alaska-based freelance writer and editor Rob LeFebvre is Cult of Mac's Culture Editor. He has contributed to various tech, gaming and iOS sites, including 148Apps, VentureBeat, and Paste Magazine. Feel free to find Rob on Twitter @roblef

(sorry, you need Javascript to see this e-mail address)| Read more posts by .

Posted in OS X, Tips & Tricks | Tagged: , , , , , , |