Geek Posted February 2, 2012 Posted February 2, 2012 <div class="KonaBody"><p><img src="http://osxdaily.com/wp-content/uploads/2012/01/spotlight.jpg" alt="Spotlight" title="spotlight" width="200" height="202" class="alignright size-full wp-image-26760" /> Spotlight is generally very good at keeping a valid index of a drives contents up to date, but if you’ve recently restored a drive or had to delete the Spotlight index for one reason or another, you may need to reindex the drive manually. This is <a href="http://osxdaily.com/2012/01/17/rebuild-spotlight-index/">easy from the Spotlight control panel</a>, and can also be achieved through the command line as we’ll demonstrate.</p> <h2 style="font-size:1.2em;">Reindexing Spotlight from the Command Line</h2> <p>Reindexing Spotlight from the command line is done with the mdutil tool, first launch Terminal and then type:</p> <p><code>sudo mdutil -E /</code></p> <p>This will reindex every mounted volume on the Mac, including hard drives, disk images, external drives, etc. Specific drives can be chosen by pointing to them in /Volumes/, to only rebuild the primary Macintosh HD:</p> <p><code>sudo mdutil -E /Volumes/Macintosh HD/</code></p> <p>To reindex an external drive named “External” the command would be:</p> <p><code>sudo mdutil -E /Volumes/External/</code></p> <p>Use of the mdutil command will spin up <a href="http://osxdaily.com/2010/08/05/mds-mac/">mds</a> and <a href="http://osxdaily.com/2009/09/14/mdworker-what-is-mdworker/">mdworker</a> processes as Spotlight goes to work. </p> <p><strong>Individually Reindexing Selected Files</strong> In rare cases, Spotlight can miss a file during index, so rather than reindex an entire drive you can also manually add an individual file to the search index with the mdimport command:</p> <p><code>mdimport /path/to/file</code></p> <p>The mdimport command can be used on directories as well.</p> </div> <p><a href="http://feedads.g.doubleclick.net/~a/MgGNX9Mam8yEM5-7Tpd74Ss-LR4/0/da"><img src="http://feedads.g.doubleclick.net/~a/MgGNX9Mam8yEM5-7Tpd74Ss-LR4/0/di" border="0" ismap="true"></img></a><br/> <a href="http://feedads.g.doubleclick.net/~a/MgGNX9Mam8yEM5-7Tpd74Ss-LR4/1/da"><img src="http://feedads.g.doubleclick.net/~a/MgGNX9Mam8yEM5-7Tpd74Ss-LR4/1/di" border="0" ismap="true"></img></a></p><div class="feedflare"> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=6H7rRWhywPs:sIIODkplXXo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=6H7rRWhywPs:sIIODkplXXo:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=6H7rRWhywPs:sIIODkplXXo:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=6H7rRWhywPs:sIIODkplXXo:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/osxdaily?i=6H7rRWhywPs:sIIODkplXXo:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=6H7rRWhywPs:sIIODkplXXo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/osxdaily?a=6H7rRWhywPs:sIIODkplXXo:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/osxdaily?d=qj6IDK7rITs" border="0"></img></a> </div><img src="http://feeds.feedburner.com/~r/osxdaily/~4/6H7rRWhywPs" height="1" width="1"/> View the full article
Recommended Posts