Manpage Monday: PlistBuddy(8)
PlistBuddy(8) is a command-line tool for editing property-list files, with a deeper reach than plutil defaults:
Entries consist of property key names delimited by colons. Array items are specified by a zero-based integer index. Examples:
:CFBundleShortVersionString :CFBundleDocumentTypes:2:CFBundleTypeExtensions
Jonathan “Wolf” Rentzsch, in his del.icio.us bookmark for the manpage, says that PlistBuddy is “always at /usr/libexec/PlistBuddy on modern systems”.
April 13th, 2009 at 15:54:46
PlistBuddy and plutil arn’t really comparable. plutil is only good for checking that plists are structurally valid, and changing between binary and xml formats.
I think you meant to compare PlistBuddy to the ‘defaults’ command. If so, then the comparison is apt, and PlistBuddy can help system administrators (or package writers) work with plists much better than the ‘defaults’ command. The most important differnce for most situations is that PlistBuddy allows you to set preferences that are one or more branches deep in a plist without replacing everything along that branch.
It does have its own limitations, but is a valuable tool. For anyone looking to learn a little more about PlistBuddy, some time ago I wrote a snippit about it in an article I wrote: http://prowiki.isc.upenn.edu/wiki/Manipulating_Plists
And my memory is that PlistBuddy being in /usr/libexec/ happened sometime after 10.5.0. Maybe 10.5.1 or 10.5.2. A little searching has failed to turn up the exact spot though.
April 13th, 2009 at 20:34:12
Indeed I did. Thanks!