Why defaults read can't read some domains?And why is there an plist that stores all my information?

defaults read will output all domain contents and defaults domains will output all domain names. However, I found that when I manually specify some domainsdefaults read com.valvesoftware.steam.helper, I get an error that domain does not exist but the file is there. E.g:

~/Library/Preferences/com.valvesoftware.steam.helper
~/LibraryL/Containers/com.apple.Preview/Data/Library/Preferences/com.apple.Preview.ImageSizingPresets
~/LibraryL/Containers/com.apple.Preview/Data/Library/Preferences/com.apple.Preview.ViewState
~/LibraryL/Containers/com.apple.Preview/Data/Library/Preferences/com.apple.Preview.bookmarks
~/LibraryL/Containers/com.apple.Preview/Data/Library/Preferences/com.apple.PreviewLegacySignaturesConversion

Two files in same folder but only one of them get an error.

~/Library/Containers/com.microsoft.Excel/Data/Library/Preferences/com.microsoft.Excel.plist 
~/Library/Containers/com.microsoft.Excel/Data/Library/Preferences/com.microsoft.Excel.securebookmarks.plist

And why is there an plist that stores all my information even my keyboard model. co.twopeople.mate.plist contains even more information than Apple Global Domain


Solution 1:

Why defaults read can't read some domains?

It returns an unintuitive message for when a domain is blank. For example, a fresh install of Firefox may create /Library/Preferences/org.mozilla.firefox.plist, however when trying to read this file:

defaults read /Library/Preferences/org.mozilla.firefox.plist

# errors with:
# Domain /Library/Preferences/org.mozilla.firefox.plist does not exist

If you convert the .plist to xml you can see it exists but it's blank...

sudo plutil -convert xml1 /Library/Preferences/org.mozilla.firefox.plist
cat /Library/Preferences/org.mozilla.firefox.plist

... shows

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>

So this message is simply misleading for blank .plist files. Note, a similar misleading message may occur if you do not have proper access to read and/or delete a file or setting.

And why is there an plist that stores all my information even my keyboard model. co.twopeople.mate.plist contains even more information than Apple Global Domain

It's impossible to know, but you may consider reaching out the developers of that app, it's not something present on any of my machines, so it was likely installed by a 3rd party program that you used in the past.