Apple Mac OS X Server Network Card User Manual


 
Chapter 7 Working with Disks and Volumes 93
3 Restart your server.
To enable Spotlight on your server:
1 Open /etc/hostconfig for editing as root.
2 Change the value of the spotlight parameter to -YES-.
You can also set the value of the SPOTLIGHT parameter to -YES- as follows:
$ sudo /System/Library/ServerSetup/serversetup -setAutoStartSpotlight 1
3 Restart your server.
Performing Spotlight Searches
Mac OS X provides the ability to view the metadata of a file and perform Spotlight
searches from the command line.
To view a file’s Spotlight metadata, use the mdls tool. This tool, which is similar to the ls
tool, lists all of the metadata attributes for a specific file.
To view the metadata of a file:
$ mdls
filename
The computer will respond with something similar to the following output:
<
filename> -------------
kMDItemAttributeChangeDate = 1970-01-01 00:43:07 -0600
kMDItemFSContentChangeDate = 2005-10-03 22:04:19 -0500
kMDItemFSCreationDate = 2005-10-03 22:04:19 -0500
kMDItemFSCreatorCode = 0
kMDItemFSFinderFlags = 16384
kMDItemFSInvisible = 1
kMDItemFSIsExtensionHidden = 0
kMDItemFSLabel = 0
kMDItemFSName = "
filename
"
kMDItemFSNodeCount = 0
kMDItemFSOwnerGroupID = 0
kMDItemFSOwnerUserID = 0
kMDItemFSSize = 4330232
kMDItemFSTypeCode = 0
kMDItemID = 634516
kMDItemLastUsedDate = 2005-10-03 21:04:19 -0500
kMDItemUsedDates = (2005-10-03 21:04:19 -0500)
To perform a Spotlight search, use the mdfind tool:
$ mdfind “kMDItemAcquisitionModel ==’Canon Powershot S45’”
/Users/anne/Documents/vacation1.jpg
/Users/anne/Documents/vacation2.jpg
/Users/anne/Documents/vacation3.jpg
/Users/anne/Documents/vacation4.jpg