plistBuddy [-xh][ -c command] file.plist
Some of the configuration files in Mac OS (found in /System/Library/LaunchDaemons , etc) are in xml format
(for example ftp.plist, (as of 10.9.5 233 XML, 21 binary), which can be edited with a text editor.
The "Apple binary property list" ones must be edited with plistBuddy a command processor ( or the GUI lingon)
-c command |
Example:
/Library/Preferences % ls -l com.apple.apsd.plist -rw------- 1 root wheel 68217 Feb 22 16:38 com.apple.apsd.plist dgec14 Preferences % sudo plistBuddy + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + print …
Merge file [entry] |
Entries consist of property key names delimited by colons (:).
Array items are specified by a
Many property key names are program specific.
:CFBundleShortVersionString
:CFBundleDocumentTypes:2:CFBundleTypeExtensions
Entry types: string, array, dict, bool, real, integer, date or data
Set the CFBundleIdentifier property to com.apple.plistbuddy: Set :CFBundleIdentifier com.apple.plistbuddy
Add the CFBundleGetInfoString property to the plist: Add :CFBundleGetInfoString string "App version 1.
Add a new item of type dict to the CFBundleDocumentTypes array: Add :CFBundleDocumentTypes: dict
Add the new item to the beginning of the array: Add :CFBundleDocumentTypes:
Delete the FIRST item in the array: Delete :CFBundleDocumentTypes:
Delete the ENTIRE CFBundleDocumentTypes array: Delete :CFBundleDocumentTypes
> plistbuddy com.apple.TimeMachine.plist
Command: print
Dict {
LastDestinationID = 577AB420-2EA6-4BED-8E03-4E1203DFD882
MobileBackups = false
HostUUIDs = Array {
9205DB27-ADBE-5C67-B58F-AE743BF777D9
}
LocalizedDiskImageVolumeName = Time Machine Backups
BackupAlias = & DGerman1aȬlH+ DGerman1aȬl???? DGerman1Ȭ?Ȭ?_DGerman1a:DGerman1a DGerman1a DGerman1a/Volumes/DGerman1a??†
PreferencesVersion = 4
RootVolumeUUID = 8CBD0C14-6A08-3663-A911-CE7D1DB594B0
Destinations = Array {
Dict {
RESULT = 0
BytesUsed = 267603189760
DestinationID = 577AB420-2EA6-4BED-8E03-4E1203DFD882
SnapshotDates = Array {
Mon Mar 03 23:39:29 EST 2014
Thu Mar 20 20:26:39 EST 2014
Sat Apr 12 21:16:21 EST 2014
Sat Apr 26 16:33:53 EST 2014
Fri Jun 06 16:33:13 EST 2014
Sat Jul 05 08:26:09 EST 2014
Sun Sep 14 09:53:19 EST 2014
}
BackupAlias = & DGerman1aȬlH+ DGerman1aȬl???? DGerman1Ȭ?Ȭ?_DGerman1a:DGerman1a DGerman1a DGerman1a/Volumes/DGerman1a??†
BytesAvailable = 212371472384
DestinationUUIDs = Array {
B2BA3CA8-984F-39F5-8A16-261BCBC2CE28
}
}
}
ExcludeByPath = Array {
//Users/Shared/adi
/Users/Shared/adi
/Library/Application Support/Microsoft/PlayReady
}
AutoBackup = false
}
com.apple.Syslog.plist
Command: print
…
ProgramArguments = Array {
/usr/sbin/syslogd
}
…
Command: delete ProgramArguments
Command: add ProgramArguments array
Command: add ProgramArguments:0 string "/usr/sbin/syslogd -d" ## Add debug flag
Command: print
…
ProgramArguments = Array {
/usr/sbin/syslogd -d
}
…
> plistbuddy com.apple.iokit.AmbientLightSensor.plistrray {
/usr/sbin/syslogd -d
}
Command: print
Dict {
Lux 1 = 0.000000
Keyboard Muted = false
LuxSensor 1 = 84.000000
LuxSensor 2 = 215.000000
Keyboard Dim Time = -1
Keyboard Manual Brightness = 1.000000
Keyboard User Offset = 0.261857
Lux 2 = 215.000000
Backlight 1 = 0.428367
Lux Threshold = 128.153519
Backlight 2 = 1.147028
Automatic Keyboard Enabled = true
}
/Library/Preferences/com.apple.apsd.plist /System/Library/LaunchDaemons/com.apple.apsd.plist /System/Library/Preferences/Logging/Subsystems/com.apple.apsd.plist /System/Library/PrivateFrameworks/ApplePushService.framework/Versions/A/Resources/com.apple.apsd.plist /System/Volumes/Update/mnt1/System/Library/LaunchDaemons/com.apple.apsd.plist /System/Volumes/Update/mnt1/System/Library/PrivateFrameworks/ApplePushService.framework/Versions/A/Resources/com.apple.apsd.plistcom.apple.apsd.plist
Encountered unknown tag galileoConfig on line 2 Error Reading File: galileo_config.xmlPerhaps a text xml file, try editing it. Invalid Arguments plistB not plistbuddy !