OsxSpotLight

WebHome | UnixGeekTools | Geekfarm | About This Site

command line fu

Tiger ships with a nice collection of command-line tools for Spotlight, all of which share the "md" prefix (which stands for "metadata," in case you haven't guessed already). The mdfind command accepts text queries like the one shown above and prints out all the matching files. The mdls command will list all the attribute names and values in the Spotlight metadata store for a particular file. The mdimport command forces a file to be (re)indexed by Spotlight. The mdcheckschema command is used to validate the configuration of an individual metadata importer plug-in. The mdutil command, which must be run as root, is used to manage the Spotlight metadata stores. These tools are useful for developers creating metadata importer plug-ins, or even for users who are just curious. - source

Disabling spotlight on a volume

    # disable for volume
    $ sudo mdutil -i off /Volumes/your_hard_drive_name_2

    # may need to kill off mds processes at this point if indexing is
    # already underway

    # remove the index to free up space
    $ sudo mdutil -E /Volumes/your_hard_drive_name_2

    # remove the spotlight directory
    $ cd /Volumes/your_hard_drive_name_2
    $ sudo rm -fr .Spotlight-V100
    $ sudo mdutil -i on /Volumes/your_hard_drive_name_2

overriding default types




Updated Sun Jul 23, 2006 12:13 PM