Changing Plist files with Defaults Command In Mac

While preparing for series of Jamf certifications I stumbled upon .plist files in Mac which show preferences of system or a specific user. I thought it would be interesting to play around with them and see how system preferences reflect on all users and how to twinkle preferences via terminal. Changing such settings via terminal is time-efficient. Below are com.service.plist files

I would like to change dock for my specific user which I can do via the following command:

defaults write com.apple.dock orientation left

This does not do anything to my dock, however. That is because the following process is still alive:

We need to kill this process and proceed. Simple kill 952 command resets this process and we have:

Now the dock in on left. Similarly, had I specified on right or top it would be there. This can be played with any .plist files and this tool is powerful because I reached this only with two commands. While GUI is easy, there are times that GUI may not be available. For example, I am remoting to user’s machine with a remote tool such as BeyondTrust, and GUI stopped working or user is prompted with admin credentials (as it is the case with Macs), I might need to suffice with terminal to change user’s preferences or system settings.

In either case, it is a fun thing I learned while preparing for my Jamf 100 certification. If you enjoy my blogs, feel free to visit other ones! I try to post everything from simple tweaking like this one to more complex labs. Thanks for reading!


Leave a Reply

Your email address will not be published. Required fields are marked *