Command-line options for viewing Plist files:
- For viewing only: Use
plutil -p
, which prints the content of a property-list in JSON-like format (the format is meant for human consumption only).
Example (append | open -tf
to view output in a text editor):
plutil -p ~/Library/Preferences/com.apple.sidebarlists.plist
- Alternative: Use
/usr/libexec/PlistBuddy -c print
, which outputs in JavaScript-object-literal-like format:
Example:
/usr/libexec/PlistBuddy -c print ~/Library/Preferences/com.apple.airplay.plist
Caveat:
If the plist has properties containing binary data, PlistBuddy
will include it in raw form (by contrast, non-binary properties in the same file are printed properly). If XML output is desired, add option -x
.
Note that PlistBuddy
:
- can be used to extract properties selectively using
:
-separated, case-sensitive property paths; e.g., /usr/libexec/PlistBuddy -c 'print :favorites:ShowRemovable' ~/Library/Preferences/com.apple.sidebarlists.plist
- is also capable of modifying Plist files from the command line (including, with limitations, importing from previously exported-to XML files).
See /usr/libexec/PlistBuddy -h
for details.