Command line options for viewing Plist files:
- View only . Use
plutil -p , which prints the contents of the property list in JSON format (the format is for human consumption only).
Example (append | open -tf for viewing output in a text editor):
plutil -p ~/Library/Preferences/com.apple.sidebarlists.plist
- Alternative . Use
/usr/libexec/PlistBuddy -c print , which /usr/libexec/PlistBuddy -c print in JavaScript-object-literal-like format:
Example:
/usr/libexec/PlistBuddy -c print ~/Library/Preferences/com.apple.airplay.plist
Caveat : If plist has properties containing binary data, PlistBuddy will include it in its raw form (on the contrary, non-binary properties in the same file print correctly). If XML output is required, add the -x option.
Please note that PlistBuddy :
- can be used to retrieve properties selectively using
: -separated, case-sensitive path properties; e.g. /usr/libexec/PlistBuddy -c 'print :favorites:ShowRemovable' ~/Library/Preferences/com.apple.sidebarlists.plist - it is also capable of modifying Plist files from the command line (including, with limitations, importing from previously exported files into XML).
See /usr/libexec/PlistBuddy -h more details.
source share