Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Finding the right macOS `defaults` command

Posted on Oct 1 Automating the setup of a clean macOS install is a lot easier when you know which keys to edit via the defaults command. Since there's no official listing of all the keys, there are places online that give you the most commonly used ones and try to stay up to date with the names of the keys in the latest release of macOS, with varying degrees of success. The best way is to grab the correct names directly from your Mac. Note: First, make sure your terminal has Full Disk Access in System Settings > Privacy and Security.The format to edit your macOS preferences isdefaults write $DOMAIN $KEY -$TYPE $VALUEAnd you can list all the domains withdefaults domains | tr ', ' '\n'You can figure out the correct domain and key names by comparing the output of defaults read before and after manually changing a setting in the UI. You can also specify a domain to narrow down the output but it's not required so don't worry if you're not sure which domain is affected by the setting you're interested in. Remember to kill any affected apps to apply the changes.Example:Now check the type and you got a command you can add to any automation you wish.If you can't find a key where you expected it, remove the domain from your query or check the global domain. This one affects Finder but it's in the global domain instead of com.apple.finder.Other commands to try:Want an example of a setup script? Check out mine.Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Mila Wu - Sep 4 William Baptist - Aug 21 Daniel Rendox - Sep 3 Shshank - Sep 3 Once suspended, santisbon will not be able to comment or publish posts until their suspension is removed. Once unsuspended, santisbon will be able to comment and publish posts again. Once unpublished, all posts by santisbon will become hidden and only accessible to themselves. If santisbon is not suspended, they can still re-publish their posts from their dashboard. Note: Once unpublished, this post will become invisible to the public and only accessible to Armando C. Santisbon. They can still re-publish the post if they are not suspended. Thanks for keeping DEV Community safe. Here is what you can do to flag santisbon: santisbon consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy. Unflagging santisbon will restore default visibility to their posts. DEV Community — A constructive and inclusive social network for software developers. With you every step of your journey. Built on Forem — the open source software that powers DEV and other inclusive communities.Made with love and Ruby on Rails. DEV Community © 2016 - 2023. We're a place where coders share, stay up-to-date and grow their careers.



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

Finding the right macOS `defaults` command

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×