What is a Property List (plist) File?
In macOS, almost every application, background daemon, and system configuration setting stores its foundational preferences in Property List files, commonly known as .plist files. These files dictate everything from the default behavior of the Safari browser to the launch arguments of the Apache web server.
Historically, .plist files were simple XML documents that you could open and edit in any basic text editor. However, to improve read speeds and system performance, Apple began compiling many of these files into a proprietary binary format. If you open a binary .plist file in a text editor, you will only see scrambled, unreadable characters.
The plutil (Property List Utility) is the native macOS command-line tool designed to check the syntax of, convert, and safely edit these configuration files without corrupting them.
Step 1: Check the Syntax (Linting)
Before you ever edit a configuration file on a server or a production Mac, you should verify that it isn’t already corrupted. If a background service (like launchd) attempts to read a .plist file with a missing XML bracket, the service will instantly crash.
To check the syntax of a file, use the -lint flag:
plutil -lint /Library/Preferences/com.apple.TimeMachine.plist
If the file is perfectly structured, the Terminal will output: file.plist: OK. If there is a syntax error, plutil will output the exact line number where the code is broken, allowing you to fix it before restarting the service.
Step 2: Convert Binary to Human-Readable XML
If you need to manually inspect or deeply edit a compiled binary .plist file, you must first convert it back into standard, readable XML.
You can do this using the -convert xml1 flag:
sudo plutil -convert xml1 /Library/Preferences/com.apple.SoftwareUpdate.plist
This command rewrites the file in place. You can now open it in nano, vim, or Xcode and read the standard XML keys and strings. Once you have finished making your edits, you can leave it as XML (macOS can read both formats), or you can compile it back to binary for maximum performance:
sudo plutil -convert binary1 /Library/Preferences/com.apple.SoftwareUpdate.plist
Step 3: Edit Keys Directly via Command Line
The true power of plutil for system administrators is its ability to surgically insert or modify data inside a .plist file directly from a bash script, without needing to convert the file to XML or open a text editor.
Suppose you are writing an MDM deployment script and you need to force a custom application’s configuration file to update a specific key. You can use the -replace flag to instantly overwrite a value.
For example, to change the “AutoCheckEnabled” boolean key to “true”:
sudo plutil -replace AutoCheckEnabled -bool YES /Library/Preferences/com.example.App.plist
To insert a brand new string value (like a license key) that doesn’t currently exist in the file, use the -insert flag:
sudo plutil -insert LicenseCode -string "ABC-12345" /Library/Preferences/com.example.App.plist
Step 4: View Data Without Converting
If you only need to read a specific value from a binary .plist file, converting the entire file to XML is unnecessary. You can use the -p (print) flag to dump the contents into the Terminal in a highly readable JSON-style format.
plutil -p /Library/Preferences/SystemConfiguration/preferences.plist
This prints the hierarchical structure of the data directly to your screen, allowing you to quickly grep for the specific network configuration or preference you are troubleshooting.