Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Am looking to edit system preferences settings via the command line but cannot for the life of me find the correct names of variables.

In Login Options under Users & Groups, I would like to be able to change the Display login window from list of users to 'name and password'.
In Date & Time, I would like to know how I change the time to a server we use. Enable fields in Sharing Setup Energy Saver settings

It would be great if someone can help me out or point me in the right direction as I know you edit the preferences .plists but its knowing what to add or finding the preferred naming conventions.


share|improve this question
Did you manage to configure the login options? – user87208 Aug 8 '14 at 20:49

First off, you can check out a website that lists a lot of these things:

I, however, just took a brute-force solution:

Copy the Preferences folder

$ cp -r /Library/Preferences before

Launch System Preferences. Make a change via the GUI. Probably best to do one change at a time, e.g. I changed "Display Login Window as:" from "List of users" to "Name and password". Quit System Preferences.

Copy the Preferences folder again:

$ cp -r /Library/Preferences after

See which files changed:

$ diff -ur before after
Binary files before/Preferences/ and after/Preferences/ differ

Compare the two versions. Since they are binary files, you'll need to convert them to XML for comparison. I use an alias for this:

$ alias plist='plutil -convert xml1 -o /dev/stdout'
$ diff -u <(plist before/Preferences/ <(plist after/Preferences/
--- /dev/fd/63  2013-01-23 18:20:29.000000000 +0200
+++ /dev/fd/62  2013-01-23 18:20:29.000000000 +0200
@@ -9,7 +9,7 @@
-   <false/>
+   <true/>

At this point we have located the setting. Confirm we have it with defaults:

$ defaults read /Library/Preferences/ SHOWFULLNAME
$ sudo defaults write /Library/Preferences/ SHOWFULLNAME -bool false
$ defaults read /Library/Preferences/ SHOWFULLNAME

Launch System Preferences and confirm it changed.

share|improve this answer

sudo opensnoop -n cfprefsd shows what property lists are being accessed. You can also just sort the preference files by modification date: ls -t {~,}/Library/Preferences/{ByHost,}.

For preferences in the user domain, you can also run defaults read > temp, change some preference, and run diff temp <(defaults read).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.