CLI commands that let you access meta data of all files in OSX

Apple, CLI, Lion, Mountain Lion, OSX, osx Server, spotlight, Tip, Tricks
Two small commands with huge possibilities: mdls¬† usage: mdls [-name attr] [-raw [-nullMarker markerString]] [-plist file] pathlist the values of one or all the attributes of the specified file -raw: don't print attribute names before values -nullMarker: substitute this string for null attributes in raw mode -plist: output attributes in XML format to file. Use - to write to stdout option -plist is incompatible with options -raw, -nullMarker, and -nameexample: mdls ~/Pictures/Birthday.jpgexample: mdls -name Keyword ~/Pictures/Birthday.jpg mdfind Usage: mdfind [-live] [-count] [-onlyin directory] [-name fileName | -s smartFolderName | query] list the files matching the query query can be an expression or a sequence of words -live Query should stay active -count Query only reports matching items count -onlyin <dir> Search only within given directory -name <name> Search on file…
Read More

How to turn Spotlight OFF (and ON Again)….Leopard Solution

Apple, Macintosh, OSX, osx Server, spotlight
A number of people mentioned that the previous tip on how to turn spotlight on/off does not work with Leopard. Now that I've had a bit of time, I've confirmed this and found a way around it (it's even easier in Leopard). Here are the details specifically for OSX 10.5+ (Leopard).To turn off Spotlight service temporarily% sudo launchctl unload /System/Library/LaunchDaemons/ turn off Spotlight service permanently (no worries, you can turn it on again)% sudo launchctl unload -w /System/Library/LaunchDaemons/ turn on Spotlight service temporarily% sudo launchctl load /System/Library/LaunchDaemons/ turn on Spotlight service permanently% sudo launchctl load -w /System/Library/LaunchDaemons/ Have fun....
Read More

How to turn Spotlight OFF (and ON Again)….

Macintosh, OSX, spotlight
UPDATE: Please see this article if you use Leopard (OSX 10.5+). The procedure below, although not damaging, works for 10.4 and below (Tiger). Thanks to Anonymous for pointing this out.Got a new Macbook thru work today and after Firewire targeting my profile over from my personal MBP, I started looking around the blog for the entry that shows you how to turn off Spotlight. You see Spotlight is a good idea, but I think it needs a bit more work. I've noticed that on my MBP and older Dual G5 machines, the mds service sometimes just goes nuts (usually corrupt files or something like that), and brings the machine to a halt. So I like to turn Spotlight off ASAP. Here is how:Edit /etc/hostconfig (don't forget to sudo) and change…
Read More