macOS Defaults

macos
config
admin
terminal
cli
Author

Mariusz S. Jurgielewicz

Published

December 3, 2022

macOS applications and other programs use the defaults system to record user preferences and other information to be maintained when the application isn’t running (font for new documents, or the position of an Info panel). Much of this information is accessible through an application’s Preferences panel but sometimes they’re hidden. User defaults belong to domains, which typically correspond to individual applications. Applications, system services, and other programs have their own domains, they also share a domain named NSGlobalDomain. If a default isn’t specified in the application’s domain, it may be specified in NSGlobalDomain.

Read all defaults

defaults read

List all domains

defaults domains

All defaults by domain

for i in `defaults domains | tr ',' '\n'`; do echo "********* $i **********"; echo; defaults read $i; done

List all entries containing word

defaults find Finder

Show the type for the given domain, key

defaults read-type ${domain} ${key}

Rename old_key to new_key

defaults rename ${domain} ${old_key} ${new_key}

Dock

Postition

### Read current value
defaults read com.apple.dock orientation
### Set to "left"
defaults write com.apple.dock orientation -string "left" && killall Dock
### Reset to default value
defaults delete com.apple.dock orientation && killall Dock

Change macOS Dock icon size

### Read current value
defaults read com.apple.dock tilesize
### Set to 36
defaults write com.apple.dock tilesize -int "36" && killall Dock
### Reset to default value
defaults delete com.apple.dock tilesize && killall Dock

Enable highlight hover effect for the grid view of a stack (Dock)

### Read current value
defaults read com.apple.dock mouse-over-hilite-stack
### Set to true
defaults write com.apple.dock mouse-over-hilite-stack -bool true && killall Dock
### Reset to default value
defaults delete com.apple.dock mouse-over-hilite-stack && killall Dock

Autohide

### Read current value
defaults read com.apple.dock "autohide"
### Always display the Dock
defaults write com.apple.dock "autohide" -bool "false" && killall Dock
### Autohide the Dock when the mouse is out
defaults write com.apple.dock "autohide" -bool "true" && killall Dock
### Reset to default value
defaults delete com.apple.dock "autohide" && killall Dock

Autohide animation time

### Read current value
defaults read com.apple.dock autohide-time-modifier
### Set to 0.5 (default value)
defaults write com.apple.dock autohide-time-modifier -float "0.5" && killall Dock
### Reset to default value
defaults delete com.apple.dock autohide-time-modifier && killall Dock

Show recents

### Read current value
defaults read com.apple.dock show-recents
### Set to true (default value)
defaults write com.apple.dock show-recents -bool "true" && killall Dock
### Reset to default value
defaults delete com.apple.dock show-recents && killall Dock

Disable the Launchpad gesture (pinch with thumb and three fingers)

### Read current value
defaults read com.apple.dock showLaunchpadGestureEnabled
### Set to 0
defaults write com.apple.dock showLaunchpadGestureEnabled -int 0 && killall Dock
### Reset to default value
defaults delete com.apple.dock showLaunchpadGestureEnabled && killall Dock

Add a spacer to the left side of the Dock (where the applications are)

### Read current value
defaults read com.apple.dock persistent-apps
### Set to 
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' && killall Dock
### Reset to default value
defaults delete com.apple.dock persistent-apps && killall Dock

Add a spacer to the right side of the Dock (where the Trash is)

### Read current value
defaults read com.apple.dock persistent-others
### Set to 
defaults write com.apple.dock persistent-others -array-add '{tile-data={}; tile-type="spacer-tile";}' && killall Dock
### Reset to default value
defaults delete com.apple.dock persistent-others && killall Dock

Hot corners Possible values: 0: no-op 2: Mission Control 3: Show application windows 4: Desktop 5: Start screen saver 6: Disable screen saver 7: Dashboard 10: Put display to sleep 11: Launchpad 12: Notification Center 13: Lock Screen

Top left screen corner → Mission Control

### Read current value
defaults read com.apple.dock wvous-tl-corner
defaults read com.apple.dock wvous-tl-modifier
### Set to 
defaults write com.apple.dock wvous-tl-corner -int 2
defaults write com.apple.dock wvous-tl-modifier -int 0
### Reset to default value
defaults delete com.apple.dock wvous-tl-corner
defaults delete com.apple.dock wvous-tl-modifier

#Top right screen corner → Desktop

### Read current value
defaults read com.apple.dock wvous-tr-corner
defaults read com.apple.dock wvous-tr-modifier
### Set to 
defaults write com.apple.dock wvous-tr-corner -int 4
defaults write com.apple.dock wvous-tr-modifier -int 0
### Reset to default value
defaults delete com.apple.dock wvous-tr-corner
defaults delete com.apple.dock wvous-tr-modifier

Bottom left screen corner → Start screen saver

### Read current value
defaults read com.apple.dock wvous-bl-corner
defaults read com.apple.dock wvous-bl-modifier
### Set to 
defaults write com.apple.dock wvous-bl-corner -int 5
defaults write com.apple.dock wvous-bl-modifier -int 0
### Reset to default value
defaults delete com.apple.dock wvous-bl-corner
defaults delete com.apple.dock wvous-bl-modifier

Minimize animation effect

### Read current value
defaults read com.apple.dock "mineffect"
### Set to genie (default value)
defaults write com.apple.dock "mineffect" -string "genie" && killall Dock
### Set to scale
defaults write com.apple.dock "mineffect" -string "scale" && killall Dock
### Set to suck
defaults write com.apple.dock "mineffect" -string "suck" && killall Dock
### Reset to default value
defaults delete com.apple.dock "mineffect" && killall Dock

Minimize windows into their application’s icon

### Read current value
defaults read com.apple.dock minimize-to-application
### Set to true
defaults write com.apple.dock minimize-to-application -bool true && killall Dock
### Reset to default value
defaults delete com.apple.dock minimize-to-application && killall Dock

Active applications only Only show opened apps in Dock.

### Read current value
defaults read com.apple.dock "static-only"
### Set to true
defaults write com.apple.dock "static-only" -bool "true" && killall Dock
### Reset to default value
defaults delete com.apple.dock "static-only" && killall Dock

Don’t animate opening applications from the Dock

### Read current value
defaults read com.apple.dock launchanim
### Set to false
defaults write com.apple.dock launchanim -bool false && killall Dock
### Reset to default value
defaults delete com.apple.dock launchanim && killall Dock

Speed up Mission Control animations

### Read current value
defaults read com.apple.dock expose-animation-duration
### Set to 0.1
defaults write com.apple.dock expose-animation-duration -float 0.1 && killall Dock
### Reset to default value
defaults delete com.apple.dock expose-animation-duration && killall Dock

Don’t group windows by application in Mission Control (i.e. use the old Exposé behavior instead)

### Read current value
defaults read com.apple.dock expose-group-by-app
### Set to false
defaults write com.apple.dock expose-group-by-app -bool false && killall Dock
### Reset to default value
defaults delete com.apple.dock expose-group-by-app && killall Dock

Disable Dashboard

### Read current value
defaults read com.apple.dashboard mcx-disabled
### Set to true
defaults write com.apple.dashboard mcx-disabled -bool true
### Reset to default value
defaults delete com.apple.dashboard mcx-disabled

Don’t show Dashboard as a Space

### Read current value
defaults read com.apple.dock dashboard-in-overlay
### Set to true
defaults write com.apple.dock dashboard-in-overlay -bool true && killall Dock
### Reset to default value
defaults delete com.apple.dock dashboard-in-overlay && killall Dock

Don’t automatically rearrange Spaces based on most recent use

### Read current value
defaults read com.apple.dock mru-spaces
### Set to false
defaults write com.apple.dock mru-spaces -bool false && killall Dock
### Reset to default value
defaults delete com.apple.dock mru-spaces && killall Dock

Remove the auto-hiding Dock delay

### Read current value
defaults read com.apple.dock autohide-delay
### Set to 0
defaults write com.apple.dock autohide-delay -float 0 && killall Dock
### Reset to default value
defaults delete com.apple.dock autohide-delay && killall Dock

Make Dock icons of hidden applications translucent

### Read current value
defaults read com.apple.dock showhidden
### Set to true
defaults write com.apple.dock showhidden -bool true && killall Dock
### Reset to default value
defaults delete com.apple.dock showhidden && killall Dock

Two Dimensional Dock (disable the 3D mirror glass effect)

### Read current value
defaults read com.apple.dock no-glass
### Set to true
defaults write com.apple.dock no-glass -bool true && killall Dock
### Reset to default value
defaults delete com.apple.dock no-glass && killall Dock

Three Dimensional Dock (default)

### Read current value
defaults read com.apple.dock no-glass
### Set to false
defaults write com.apple.dock no-glass -bool false && killall Dock
### Reset to default value
defaults delete com.apple.dock no-glass && killall Dock

Disable Bouncing dock icons

### Read current value
defaults read com.apple.dock no-bouncing
### Set to true
defaults write com.apple.dock no-bouncing -bool true && killall Dock
### Reset to default value
defaults delete com.apple.dock no-bouncing && killall Dock

Add a ‘Recent Applications’ stack to the Dock.

### Read current value
defaults read com.apple.dock persistent-others
### Set to true
defaults write com.apple.dock persistent-others -array-add '{ "tile-data" = { "list-type" = 1; }; "tile-type" = "recents-tile"; }' && killall Dock
### Reset to default value
defaults delete com.apple.dock persistent-others && killall Dock

Change login screen background

### Read current value
sudo defaults read /Library/Preferences/com.apple.loginwindow DesktopPicture
### Set to true
sudo defaults write /Library/Preferences/com.apple.loginwindow DesktopPicture "/Library/Desktop Pictures/Aqua Blue.jpg"
### Reset to default value
sudo defaults delete /Library/Preferences/com.apple.loginwindow DesktopPicture

Stacks, Activate Mouse Over Gradient: $ $ killall Dock To deactivate set back to NO

### Read current value
defaults read com.apple.dock mouse-over-hilte-stack
### Set to true
defaults write com.apple.dock mouse-over-hilte-stack -boolean true && killall Dock
### Reset to default value
defaults delete com.apple.dock mouse-over-hilte-stack && killall Dock

Screenshots

Disable shadow

### Read current value
defaults read com.apple.screencapture "disable-shadow"
### Set to false (default value)
defaults write com.apple.screencapture "disable-shadow" -bool "false"
### Reset to default value
defaults delete com.apple.screencapture "disable-shadow"

Include date

### Read current value
defaults read com.apple.screencapture "include-date"
### Set to true (default value)
defaults write com.apple.screencapture "include-date" -bool "true" 
### Reset to default value
defaults delete com.apple.screencapture "include-date"

Set location

### Read current value
defaults read com.apple.screencapture "location"
### Set to ~/Desktop (default value)
defaults write com.apple.screencapture "location" -string "~/Desktop" && killall SystemUIServer
### Reset to default value
defaults delete com.apple.screencapture "location" && killall SystemUIServer

Display thumbnail

### Read current value
defaults read com.apple.screencapture "show-thumbnail"
### Set to true (default value)
defaults write com.apple.screencapture "show-thumbnail" -bool "true" 
### Reset to default value
defaults delete com.apple.screencapture "show-thumbnail"

Choose screenshot format Choose the screenshots image format.

Parameter type: string * png * jpg * pdf * psd * gif * tga * tiff * bmp

### Read current value
defaults read com.apple.screencapture "type"
### Set to png (default value)
defaults write com.apple.screencapture "type" -string "png" 
### Reset to default value
defaults delete com.apple.screencapture "type"

Safari

Show full URL

### Read current value
defaults read com.apple.safari ShowFullURLInSmartSearchField
### Set to false (default value)
defaults write com.apple.safari ShowFullURLInSmartSearchField -bool "false" && killall Safari
### Reset to default value
defaults delete com.apple.safari ShowFullURLInSmartSearchField && killall Safari

Don’t send search queries to Apple

### Read current value
defaults read com.apple.Safari UniversalSearchEnabled
defaults read com.apple.Safari SuppressSearchSuggestions
### Set to false
defaults write com.apple.Safari UniversalSearchEnabled -bool false
defaults write com.apple.Safari SuppressSearchSuggestions -bool true
### Reset to default value
defaults delete com.apple.Safari UniversalSearchEnabled
defaults delete com.apple.Safari SuppressSearchSuggestions

Press Tab to highlight each item on a web page

### Read current value
defaults read com.apple.Safari WebKitTabToLinksPreferenceKey
defaults read com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks
### Set to true
defaults write com.apple.Safari WebKitTabToLinksPreferenceKey -bool true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks -bool true
### Reset to default value
defaults delete com.apple.Safari WebKitTabToLinksPreferenceKey
defaults delete com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2TabsToLinks

Set Safari’s home page to about:blank for faster loading

### Read current value
defaults read com.apple.Safari HomePage
### Set to "about:blank"
defaults write com.apple.Safari HomePage -string "about:blank"
### Reset to default value
defaults delete com.apple.Safari HomePage

Prevent Safari from opening ‘safe’ files automatically after downloading

### Read current value
defaults read com.apple.Safari AutoOpenSafeDownloads
### Set to false
defaults write com.apple.Safari AutoOpenSafeDownloads -bool false
### Reset to default value
defaults delete com.apple.Safari AutoOpenSafeDownloads

Allow hitting the Backspace key to go to the previous page in history

### Read current value
defaults read com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled
### Set to true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool true
### Reset to default value
defaults delete com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled

Hide Safari’s bookmarks bar by default

### Read current value
defaults read com.apple.Safari ShowFavoritesBar
### Set to false
defaults write com.apple.Safari ShowFavoritesBar -bool false
### Reset to default value
defaults delete com.apple.Safari ShowFavoritesBar

Hide Safari’s sidebar in Top Sites

### Read current value
defaults read com.apple.Safari ShowSidebarInTopSites
### Set to false
defaults write com.apple.Safari ShowSidebarInTopSites -bool false
### Reset to default value
defaults delete com.apple.Safari ShowSidebarInTopSites

Disable Safari’s thumbnail cache for History and Top Sites

### Read current value
defaults read com.apple.Safari DebugSnapshotsUpdatePolicy
### Set to 2
defaults write com.apple.Safari DebugSnapshotsUpdatePolicy -int 2
### Reset to default value
defaults delete com.apple.Safari DebugSnapshotsUpdatePolicy

Enable Safari’s debug menu

### Read current value
defaults read com.apple.Safari IncludeInternalDebugMenu
### Set to true
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
### Reset to default value
defaults delete com.apple.Safari IncludeInternalDebugMenu

Make Safari’s search banners default to Contains instead of Starts With

### Read current value
defaults read com.apple.Safari FindOnPageMatchesWordStartsOnly
### Set to false
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
### Reset to default value
defaults delete com.apple.Safari FindOnPageMatchesWordStartsOnly

Remove useless icons from Safari’s bookmarks bar

### Read current value
defaults read com.apple.Safari ProxiesInBookmarksBar
### Set to
defaults write com.apple.Safari ProxiesInBookmarksBar "()"
### Reset to default value
defaults delete com.apple.Safari ProxiesInBookmarksBar

Enable the Develop menu and the Web Inspector in Safari

### Read current value
defaults read com.apple.Safari IncludeDevelopMenu
defaults read com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey
defaults read com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled
### Set to true
defaults write com.apple.Safari IncludeDevelopMenu -bool true
defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
### Reset to default value
defaults delete com.apple.Safari IncludeDevelopMenu
defaults delete com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey
defaults delete com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled

Add a context menu item for showing the Web Inspector in web views

### Read current value
defaults read NSGlobalDomain WebKitDeveloperExtras
### Set to true
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
### Reset to default value
defaults delete NSGlobalDomain WebKitDeveloperExtras

Enable continuous spellchecking

### Read current value
defaults read com.apple.Safari WebContinuousSpellCheckingEnabled
### Set to true
defaults write com.apple.Safari WebContinuousSpellCheckingEnabled -bool true
### Reset to default value
defaults delete com.apple.Safari WebContinuousSpellCheckingEnabled

Disable auto-correct

### Read current value
defaults read com.apple.Safari WebAutomaticSpellingCorrectionEnabled
### Set to false
defaults write com.apple.Safari WebAutomaticSpellingCorrectionEnabled -bool false
### Reset to default value
defaults delete com.apple.Safari WebAutomaticSpellingCorrectionEnabled

Disable AutoFill

### Read current value
defaults read com.apple.Safari AutoFillFromAddressBook
defaults read com.apple.Safari AutoFillPasswords
defaults read com.apple.Safari AutoFillCreditCardData
defaults read com.apple.Safari AutoFillMiscellaneousForms
### Set to false
defaults write com.apple.Safari AutoFillFromAddressBook -bool false
defaults write com.apple.Safari AutoFillPasswords -bool false
defaults write com.apple.Safari AutoFillCreditCardData -bool false
defaults write com.apple.Safari AutoFillMiscellaneousForms -bool false
### Reset to default value
defaults delete com.apple.Safari AutoFillFromAddressBook
defaults delete com.apple.Safari AutoFillPasswords
defaults delete com.apple.Safari AutoFillCreditCardData
defaults delete com.apple.Safari AutoFillMiscellaneousForms

Warn about fraudulent websites

### Read current value
defaults read com.apple.Safari WarnAboutFraudulentWebsites
### Set to true
defaults write com.apple.Safari WarnAboutFraudulentWebsites -bool true
### Reset to default value
defaults delete com.apple.Safari WarnAboutFraudulentWebsites

Disable plug-ins

### Read current value
defaults read com.apple.Safari WebKitPluginsEnabled
defaults read com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled
### Set to false
defaults write com.apple.Safari WebKitPluginsEnabled -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled -bool false
### Reset to default value
defaults delete com.apple.Safari WebKitPluginsEnabled
defaults delete com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2PluginsEnabled

Disable Java

### Read current value
defaults read com.apple.Safari WebKitJavaEnabled
defaults read com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled
defaults read com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabledForLocalFiles
### Set to false
defaults write com.apple.Safari WebKitJavaEnabled -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabledForLocalFiles -bool false
### Reset to default value
defaults delete com.apple.Safari WebKitJavaEnabled
defaults delete com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabled
defaults delete com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaEnabledForLocalFiles

Block pop-up windows

### Read current value
defaults read com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically
defaults read com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically
### Set to false
defaults write com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically -bool false
### Reset to default value
defaults delete com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically
defaults delete com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2JavaScriptCanOpenWindowsAutomatically

Disable auto-playing video

### Read current value
defaults read com.apple.Safari WebKitMediaPlaybackAllowsInline
defaults read com.apple.SafariTechnologyPreview WebKitMediaPlaybackAllowsInline
defaults read com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback
defaults read com.apple.SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback
### Set to false
defaults write com.apple.Safari WebKitMediaPlaybackAllowsInline -bool false
defaults write com.apple.SafariTechnologyPreview WebKitMediaPlaybackAllowsInline -bool false
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
defaults write com.apple.SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback -bool false
### Reset to default value
defaults delete com.apple.Safari WebKitMediaPlaybackAllowsInline
defaults delete com.apple.SafariTechnologyPreview WebKitMediaPlaybackAllowsInline
defaults delete com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback
defaults delete com.apple.SafariTechnologyPreview com.apple.Safari.ContentPageGroupIdentifier.WebKit2AllowsInlineMediaPlayback

Enable “Do Not Track”

### Read current value
defaults read com.apple.Safari SendDoNotTrackHTTPHeader
### Set to true
defaults write com.apple.Safari SendDoNotTrackHTTPHeader -bool true
### Reset to default value
defaults delete com.apple.Safari SendDoNotTrackHTTPHeader

Update extensions automatically

### Read current value
defaults read com.apple.Safari InstallExtensionUpdatesAutomatically
### Set to true
defaults write com.apple.Safari InstallExtensionUpdatesAutomatically -bool true
### Reset to default value
defaults delete com.apple.Safari InstallExtensionUpdatesAutomatically

Mail

Disable send and reply animations in Mail.app

### Read current value
defaults read com.apple.mail DisableReplyAnimations
defaults read com.apple.mail DisableSendAnimations
### Set to true
defaults write com.apple.mail DisableReplyAnimations -bool true
defaults write com.apple.mail DisableSendAnimations -bool true
### Reset to default value
defaults delete com.apple.mail DisableReplyAnimations
defaults delete com.apple.mail DisableSendAnimations

***Copy email addresses as foo@example.com instead of Foo Bar <foo@example.com> in Mail.app

### Read current value
defaults read com.apple.mail AddressesIncludeNameOnPasteboard
### Set to true
defaults write com.apple.mail AddressesIncludeNameOnPasteboard -bool false
### Reset to default value
defaults delete com.apple.mail AddressesIncludeNameOnPasteboard

Add the keyboard shortcut ⌘ + Enter to send an email in Mail.app

### Read current value
defaults read com.apple.mail NSUserKeyEquivalents
### Set to 
defaults write com.apple.mail NSUserKeyEquivalents -dict-add "Send" "@\U21a9"
### Reset to default value
defaults delete com.apple.mail NSUserKeyEquivalents

Display emails in threaded mode, sorted by date (oldest at the top)

### Read current value
defaults read com.apple.mail DraftsViewerAttributes
### Set to 
defaults write com.apple.mail DraftsViewerAttributes -dict-add "DisplayInThreadedMode" -string "yes"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortedDescending" -string "yes"
defaults write com.apple.mail DraftsViewerAttributes -dict-add "SortOrder" -string "received-date"
### Reset to default value
defaults delete com.apple.mail DraftsViewerAttributes

Disable inline attachments (just show the icons)

### Read current value
defaults read com.apple.mail DisableInlineAttachmentViewing
### Set to true
defaults write com.apple.mail DisableInlineAttachmentViewing -bool true
### Reset to default value
defaults delete com.apple.mail DisableInlineAttachmentViewing

Disable automatic spell checking

### Read current value
defaults read com.apple.mail SpellCheckingBehavior
### Set to 
defaults write com.apple.mail SpellCheckingBehavior -string "NoSpellCheckingEnabled"
### Reset to default value
defaults delete com.apple.mail SpellCheckingBehavior

Force all Apple Mail messages to display as plain text.

### Read current value
defaults read com.apple.mail PreferPlainText
### Set to true
defaults write com.apple.mail PreferPlainText -bool true
### Reset to default value
defaults delete com.apple.mail PreferPlainText

Finder

The Finder is the default file manager on macOS. It is responsible for the launching of other applications, and for the overall user management of files, disks, and network volumes.

Quit

### Read current value
defaults read com.apple.finder "QuitMenuItem"
### Set to false (default value)
defaults write com.apple.finder "QuitMenuItem" -bool "false" && killall Finder
### Reset to default value
defaults delete com.apple.finder "QuitMenuItem" && killall Finder

Disable window animations and Get Info animations

### Read current value
defaults read com.apple.finder DisableAllAnimations
### Set to true
defaults write com.apple.finder DisableAllAnimations -bool true && killall Finder
### Reset to default value
defaults delete com.apple.finder DisableAllAnimations && killall Finder

Set Desktop as the default location for new Finder windows For other paths, use PfLo and file:///full/path/here/

### Read current value
defaults read com.apple.finder NewWindowTarget
defaults read com.apple.finder NewWindowTargetPath
### Set to 
defaults write com.apple.finder NewWindowTarget -string "PfDe"
defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/Desktop/"
### Reset to default value
defaults delete com.apple.finder NewWindowTarget
defaults delete com.apple.finder NewWindowTargetPath

Show extensions

### Read current value
defaults read NSGlobalDomain "AppleShowAllExtensions"
### Set to false (default value)
defaults write NSGlobalDomain "AppleShowAllExtensions" -bool "false" && killall Finder
### Reset to default value
defaults delete NSGlobalDomain "AppleShowAllExtensions" && killall Finder

Show hidden files Show hidden files in the Finder. You can toggle the value using ⌘ cmd+⇧ shift+..

### Read current value
defaults read com.apple.finder "AppleShowAllFiles"
### Set to false (default value)
defaults write com.apple.finder "AppleShowAllFiles" -bool "false" && killall Finder
### Reset to default value
defaults delete com.apple.finder "AppleShowAllFiles" && killall Finder

Path bar Show path bar in the bottom of the Finder windows.

### Read current value
defaults read com.apple.finder "ShowPathbar"
### Set to false (default value)
defaults write com.apple.finder "ShowPathbar" -bool "false" && killall Finder
### Reset to default value
defaults delete com.apple.finder "ShowPathbar" && killall Finder

Status bar

### Read current value
defaults read com.apple.finder ShowStatusBar
### Set to true
defaults write com.apple.finder ShowStatusBar -bool true && killall Finder
### Reset to default value
defaults delete com.apple.finder ShowStatusBar && killall Finder

Display full POSIX path as Finder window title

### Read current value
defaults read com.apple.finder _FXShowPosixPathInTitle
### Set to true
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true && killall Finder
### Reset to default value
defaults delete com.apple.finder _FXShowPosixPathInTitle && killall Finder

Enable spring loading for directories

### Read current value
defaults read NSGlobalDomain com.apple.springing.enable
### Set to true
defaults write NSGlobalDomain com.apple.springing.enabled -bool true
### Reset to default value
defaults delete NSGlobalDomain com.apple.springing.enable

Remove the spring loading delay for directories

### Read current value
defaults read NSGlobalDomain com.apple.springing.delay
### Set to 0
defaults write NSGlobalDomain com.apple.springing.delay -float 0
### Reset to default value
defaults delete NSGlobalDomain com.apple.springing.delay

Avoid creating .DS_Store files on network or USB volumes

### Read current value
defaults read com.apple.desktopservices DSDontWriteNetworkStores
defaults read com.apple.desktopservices DSDontWriteUSBStores
### Set to true
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
### Reset to default value
defaults delete com.apple.desktopservices DSDontWriteNetworkStores
defaults delete com.apple.desktopservices DSDontWriteUSBStores

Disable disk image verification

### Read current value
defaults read com.apple.frameworks.diskimages skip-verify
defaults read com.apple.frameworks.diskimages skip-verify-locked
defaults read com.apple.frameworks.diskimages skip-verify-remote
### Set to true
defaults write com.apple.frameworks.diskimages skip-verify -bool true
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
### Reset to default value
defaults delete com.apple.frameworks.diskimages skip-verify
defaults delete com.apple.frameworks.diskimages skip-verify-locked
defaults delete com.apple.frameworks.diskimages skip-verify-remote

Automatically open a new Finder window when a volume is mounted

### Read current value
defaults read com.apple.frameworks.diskimages auto-open-ro-root
defaults read com.apple.frameworks.diskimages auto-open-rw-root
defaults read com.apple.finder OpenWindowForNewRemovableDisk
### Set to true
defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
### Reset to default value
defaults delete com.apple.frameworks.diskimages auto-open-ro-root
defaults delete com.apple.frameworks.diskimages auto-open-rw-root
defaults delete com.apple.finder OpenWindowForNewRemovableDisk

Default view style

### Read current value
defaults read com.apple.finder "FXPreferredViewStyle"
### Set to icnv (default value) - Icon view
defaults write com.apple.finder "FXPreferredViewStyle" -string "icnv" && killall Finder
### Set to glyv - Gallery View
defaults write com.apple.finder "FXPreferredViewStyle" -string "glyv" && killall Finder
### Set to clmv - Column view
defaults write com.apple.finder "FXPreferredViewStyle" -string "clmv" && killall Finder
### Set to Nlsv - List view
defaults write com.apple.finder "FXPreferredViewStyle" -string "Nlsv" && killall Finder
### Reset to default value
defaults delete com.apple.finder "FXPreferredViewStyle" && killall Finder

Disable the warning before emptying the Trash

### Read current value
defaults read com.apple.finder WarnOnEmptyTrash
### Set to false
defaults write com.apple.finder WarnOnEmptyTrash -bool false && killall Finder
### Reset to default value
defaults delete com.apple.finder WarnOnEmptyTrash && killall Finder

Enable AirDrop over Ethernet and on unsupported Macs running Lion

### Read current value
defaults read com.apple.NetworkBrowser BrowseAllInterfaces 
### Set to false
defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
### Reset to default value
defaults delete com.apple.NetworkBrowser BrowseAllInterfaces

Expand the following File Info panes: * “General” * “Open with” * “Sharing & Permissions”

### Read current value
defaults read com.apple.finder FXInfoPanesExpanded
### Set to 
defaults write com.apple.finder FXInfoPanesExpanded -dict \
    General -bool true \
    OpenWith -bool true \
    Privileges -bool true
### Reset to default value
defaults delete com.apple.finder FXInfoPanesExpanded

Keep folders on top

### Read current value
defaults read com.apple.finder "_FXSortFoldersFirst"
### Set to false (default value)
defaults write com.apple.finder "_FXSortFoldersFirst" -bool "false" && killall Finder
### Reset to default value
defaults delete com.apple.finder "_FXSortFoldersFirst" && killall Finder

Default search scope

### Read current value
defaults read com.apple.finder "FXDefaultSearchScope"
### Set to SCev (default value) - Search this Mac
defaults write com.apple.finder "FXDefaultSearchScope" -string "SCev" && killall Finder
### Set to SCcf - Search the current folder
defaults write com.apple.finder "FXDefaultSearchScope" -string "SCcf" && killall Finder
### Set to SCsp - Use the previous search scope
defaults write com.apple.finder "FXDefaultSearchScope" -string "SCsp" && killall Finder
### Reset to default value
defaults delete com.apple.finder "FXDefaultSearchScope" && killall Finder

Empty bin items after 30 days

### Read current value
defaults read com.apple.finder "FXRemoveOldTrashItems"
### Set to false (default value) - Keep bin as is
defaults write com.apple.finder "FXRemoveOldTrashItems" -bool "false" && killall Finder
### Reset to default value
defaults delete com.apple.finder "FXRemoveOldTrashItems" && killall Finder

Changing file extension warning

### Read current value
defaults read com.apple.finder "FXEnableExtensionChangeWarning"
### Set to true (default value) - Display a warning when changing a file extension in the Finder
defaults write com.apple.finder "FXEnableExtensionChangeWarning" -bool "true" && killall Finder
### Reset to default value
defaults delete com.apple.finder "FXEnableExtensionChangeWarning" && killall Finder

Save to disk or iCloud by default Choose whether the default file save location is on disk or iCloud.

### Read current value
defaults read NSGlobalDomain "NSDocumentSaveNewDocumentsToCloud"
### Set to true (default value) - iCloud Documents is the default directory opened in the fileviewer dialog when saving a new document
defaults write NSGlobalDomain "NSDocumentSaveNewDocumentsToCloud" -bool "true" 
### Reset to default value
defaults delete NSGlobalDomain "NSDocumentSaveNewDocumentsToCloud"

Title bar icons

### Read current value
defaults read com.apple.universalaccess "showWindowTitlebarIcons"
### Set to false (default value) - Hide icon from the title bar
defaults write com.apple.universalaccess "showWindowTitlebarIcons" -bool "false" && killall Finder
### Reset to default value
defaults delete com.apple.universalaccess "showWindowTitlebarIcons" && killall Finder

Adjust toolbar title rollover delay

### Read current value
defaults read NSGlobalDomain "NSToolbarTitleViewRolloverDelay"
### Set to 0.5 (default value)
defaults write NSGlobalDomain "NSToolbarTitleViewRolloverDelay" -float "0.5" && killall Finder
### Reset to default value
defaults delete NSGlobalDomain "NSToolbarTitleViewRolloverDelay" && killall Finder

Set sidebar icon size

### Read current value
defaults read NSGlobalDomain "NSTableViewDefaultSizeMode"
### Set to 2 (default value)
defaults write NSGlobalDomain "NSTableViewDefaultSizeMode" -int "2" && killall Finder
### Reset to default value
defaults delete NSGlobalDomain "NSTableViewDefaultSizeMode" && killall Finder

Desktop

Keep folders on top

### Read current value
defaults read com.apple.finder "_FXSortFoldersFirstOnDesktop"
### Set to false (default value)
defaults write com.apple.finder "_FXSortFoldersFirstOnDesktop" -bool "false" && killall Finder
### Reset to default value
defaults delete com.apple.finder "_FXSortFoldersFirstOnDesktop" && killall Finder

All icons

### Read current value
defaults read com.apple.finder "CreateDesktop"
### Set to true (default value) - Show all icons
defaults write com.apple.finder "CreateDesktop" -bool "true" && killall Finder
### Reset to default value
defaults delete com.apple.finder "CreateDesktop" && killall Finder

Disks

### Read current value
defaults read com.apple.finder "ShowHardDrivesOnDesktop"
### Set to false (default value) - Hide hard disks
defaults write com.apple.finder "ShowHardDrivesOnDesktop" -bool "false" && killall Finder
### Reset to default value
defaults delete com.apple.finder "ShowHardDrivesOnDesktop" && killall Finder

External disks

### Read current value
defaults read com.apple.finder "ShowExternalHardDrivesOnDesktop"
### Set to true (default value) - Show external disks
defaults write com.apple.finder "ShowExternalHardDrivesOnDesktop" -bool "true" && killall Finder
### Reset to default value
defaults delete com.apple.finder "ShowExternalHardDrivesOnDesktop" && killall Finder

Removable media Hide removable media (CDs, DVDs and iPods) on desktop

### Read current value
defaults read com.apple.finder "ShowRemovableMediaOnDesktop"
### Set to true (default value) - Show removable media
defaults write com.apple.finder "ShowRemovableMediaOnDesktop" -bool "true" && killall Finder
Reset to default value
defaults delete com.apple.finder "ShowRemovableMediaOnDesktop" && killall Finder

Connected servers Show connected servers on desktop

### Read current value
defaults read com.apple.finder "ShowMountedServersOnDesktop"
### Set to false (default value) - Hide connected servers
defaults write com.apple.finder "ShowMountedServersOnDesktop" -bool "false" && killall Finder
### Reset to default value
defaults delete com.apple.finder "ShowMountedServersOnDesktop" && killall Finder

Spotlight

Disable Spotlight indexing for any volume that gets mounted and has not yet been indexed before. Use sudo mdutil -i off "/Volumes/foo" to stop indexing any volume.

### Read current value
sudo defaults read /.Spotlight-V100/VolumeConfiguration Exclusions
### Set to
sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes"
### Reset to default value
sudo defaults delete /.Spotlight-V100/VolumeConfiguration Exclusions

Change indexing order and disable some search results Yosemite-specific search results (remove them if you are using macOS 10.9 or older): * MENU_DEFINITION * MENU_CONVERSION * MENU_EXPRESSION * MENU_SPOTLIGHT_SUGGESTIONS (send search queries to Apple) * MENU_WEBSEARCH (send search queries to Apple) * MENU_OTHER

### Read current value
defaults read com.apple.spotlight orderedItems
### Set to
defaults write com.apple.spotlight orderedItems -array \
    '{"enabled" = 1;"name" = "APPLICATIONS";}' \
    '{"enabled" = 1;"name" = "SYSTEM_PREFS";}' \
    '{"enabled" = 1;"name" = "DIRECTORIES";}' \
    '{"enabled" = 1;"name" = "PDF";}' \
    '{"enabled" = 1;"name" = "FONTS";}' \
    '{"enabled" = 0;"name" = "DOCUMENTS";}' \
    '{"enabled" = 0;"name" = "MESSAGES";}' \
    '{"enabled" = 0;"name" = "CONTACT";}' \
    '{"enabled" = 0;"name" = "EVENT_TODO";}' \
    '{"enabled" = 0;"name" = "IMAGES";}' \
    '{"enabled" = 0;"name" = "BOOKMARKS";}' \
    '{"enabled" = 0;"name" = "MUSIC";}' \
    '{"enabled" = 0;"name" = "MOVIES";}' \
    '{"enabled" = 0;"name" = "PRESENTATIONS";}' \
    '{"enabled" = 0;"name" = "SPREADSHEETS";}' \
    '{"enabled" = 0;"name" = "SOURCE";}' \
    '{"enabled" = 0;"name" = "MENU_DEFINITION";}' \
    '{"enabled" = 0;"name" = "MENU_OTHER";}' \
    '{"enabled" = 0;"name" = "MENU_CONVERSION";}' \
    '{"enabled" = 0;"name" = "MENU_EXPRESSION";}' \
    '{"enabled" = 0;"name" = "MENU_WEBSEARCH";}' \
    '{"enabled" = 0;"name" = "MENU_SPOTLIGHT_SUGGESTIONS";}'
### Reset to default value
defaults read com.apple.spotlight orderedItems

Mission Control

Formerly known as Spaces, Mission Control allows a user to do the following:

  • ⌃ ctrl+↑ up view all open application windows.
  • ⌃ ctrl+↓ down view all open application windows of a specific application.
  • ⌘ cmd+F3 Mission Control hide all application windows and show the desktop.
  • ⌃ ctrl+← left/→ right manage application windows across multiple virtual desktops.
  • manage application windows across multiple monitors.

Rearrange automatically

### Read current value
defaults read com.apple.dock "mru-spaces"
### Set to true (default value) - Reorder Spaces based on most recent use
defaults write com.apple.dock "mru-spaces" -bool "true" && killall Dock
### Reset to default value
defaults delete com.apple.dock "mru-spaces" && killall Dock

Feedback Assistant

The Feedback Assistant app allows user to submit reports for developer or public betas.

Autogather Choose whether to autogather large files when submitting a feedback report.

### Read current value
defaults read com.apple.appleseed.FeedbackAssistant "Autogather"
### Set to true (default value) - Feedback Assistant gathers large files when submitting a report
defaults write com.apple.appleseed.FeedbackAssistant "Autogather" -bool "true"
### Reset to default value
defaults delete com.apple.appleseed.FeedbackAssistant "Autogather"

Xcode

Xcode is an integrated development environment for macOS containing a suite of software development tools developed by Apple.

Add Additional Counterpart Suffixes Add additional counterpart suffixes that Xcode should consider in the “Related Items > Counterparts” menu.

### Read current value
defaults read com.apple.dt.Xcode "IDEAdditionalCounterpartSuffixes"
### Add "ViewModel" and "View" counterpart suffixes
defaults write com.apple.dt.Xcode "IDEAdditionalCounterpartSuffixes" -array-add "ViewModel" "View" && killall Xcode
### Add the "Router", "Interactor" and "Builder" counterpart suffixes
defaults write com.apple.dt.Xcode "IDEAdditionalCounterpartSuffixes" -array-add "Router" "Interactor" "Builder" && killall Xcode
### Reset to default value
defaults delete com.apple.dt.Xcode "IDEAdditionalCounterpartSuffixes" && killall Xcode

Show Build Durations Show build durations in the Activity Viewer in Xcode’s toolbar at the top of the workspace window.

### Read current value
defaults read com.apple.dt.Xcode "ShowBuildOperationDuration"
### Set to false (default value) - Do not show the build duration in the Xcode's toolbar
defaults write com.apple.dt.Xcode "ShowBuildOperationDuration" -bool "false" && killall Xcode
### Reset to default value
defaults delete com.apple.dt.Xcode "ShowBuildOperationDuration" && killall Xcode

Simulator

Installed as part of the Xcode tools, Simulator is a Mac app simulating iPhone, iPad, Apple Watch, or Apple TV environments.

Set screenshot location

### Read current value
defaults read com.apple.iphonesimulator "ScreenShotSaveLocation"
### Set to ~/Pictures/Screenshots (default value)
defaults write com.apple.iphonesimulator "ScreenShotSaveLocation" -string "~/Pictures/Screenshots" 
### Reset to default value
defaults delete com.apple.iphonesimulator "ScreenShotSaveLocation"

TextEdit

TextEdit allows you to open and edit rich text, plain text and HTML documents.

Set default document format Set default document format as rich text (.rtf) or plain text (.txt).

### Read current value
defaults read com.apple.TextEdit RichText
### Set to true (default value) - Rich text is enabled.
defaults write com.apple.TextEdit RichText -bool true && killall TextEdit
### Reset to default value
defaults delete com.apple.TextEdit RichText && killall TextEdit

# Open and save files as UTF-8 in TextEdit

### Read current value
defaults read com.apple.TextEdit PlainTextEncoding
defaults read com.apple.TextEdit PlainTextEncodingForWrite
### Set to 4
defaults write com.apple.TextEdit PlainTextEncoding -int 4
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
### Reset to default value
defaults delete com.apple.TextEdit PlainTextEncoding
defaults delete com.apple.TextEdit PlainTextEncodingForWrite

Time Machine

Don’t offer new disks for Time Machine backup

### Read current value
defaults read com.apple.TimeMachine "DoNotOfferNewDisksForBackup"
### Set to false (default value) - When a new disk is connected, system prompts to ask if you want to use it as a backup volume.
defaults write com.apple.TimeMachine "DoNotOfferNewDisksForBackup" -bool "false" 
### Reset to default value
defaults delete com.apple.TimeMachine "DoNotOfferNewDisksForBackup"

Activity Monitor

Activity Monitor is the built-in utility for monitoring your systems resource usage, such as CPU, RAM, Disk, Network, and Energy.

Update Frequency

### Read current value
defaults read com.apple.ActivityMonitor UpdatePeriod
### Set to 5s (default value)
defaults write com.apple.ActivityMonitor UpdatePeriod -int 5 && killall Activity\ Monitor
### Reset to default value
defaults delete com.apple.ActivityMonitor UpdatePeriod && killall Activity\ Monitor

Dock Icon type * 0 - Just show the App’s regular icon. * 2 - Show Network usage over time, as two mirrored line graphs. The top (blue) chart shows down-stream traffic. The bottom (red) chart shows up-stream traffic. * 3 - Show Disk usage over time, as two mirrored line graphs. The top (blue) chart shows disk read traffic. The bottom (red) chart shows disk write traffic. * 5 - Show the current CPU usages, as a verticle meter. * 6 - Show CPU usage history, graphed over time. If your device has 4 threads or less, it’ll show one graph per thread, all stacked vertically. If you have more than 4 threads, then only one bar graph will be shown, for the total CPU usage.

### Read current value
defaults read com.apple.ActivityMonitor IconType
### Set to 0 (default value)
defaults write com.apple.ActivityMonitor IconType -int 0 && killall Activity\ Monitor
### Reset to default value
defaults delete com.apple.ActivityMonitor IconType && killall Activity\ Monitor

Show the main window when launching Activity Monitor

### Read current value
defaults read com.apple.ActivityMonitor OpenMainWindow
### Set to true
defaults write com.apple.ActivityMonitor OpenMainWindow -bool true && killall Activity\ Monitor
### Reset to default value
defaults delete com.apple.ActivityMonitor OpenMainWindow && killall Activity\ Monitor

Show all processes in Activity Monitor

### Read current value
defaults read com.apple.ActivityMonitor ShowCategory
### Set to 0
defaults write com.apple.ActivityMonitor ShowCategory -int 0 && killall Activity\ Monitor
### Reset to default value
defaults delete com.apple.ActivityMonitor ShowCategory && killall Activity\ Monitor

Sort Activity Monitor results by CPU usage

### Read current value
defaults read com.apple.ActivityMonitor SortColumn
defaults read com.apple.ActivityMonitor SortDirection
### Set to
defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
defaults write com.apple.ActivityMonitor SortDirection -int 0
### Reset to default value
defaults delete com.apple.ActivityMonitor SortColumn
defaults delete com.apple.ActivityMonitor SortDirection

Address Book, iCal and Disk Utility

Enable the debug menu in Address Book

### Read current value
defaults read com.apple.addressbook ABShowDebugMenu
### Set to true
defaults write com.apple.addressbook ABShowDebugMenu -bool true
### Reset to default value
defaults delete com.apple.addressbook ABShowDebugMenu

Enable the debug menu in iCal (pre-10.8)

### Read current value
defaults read com.apple.iCal IncludeDebugMenu
### Set to true
defaults write com.apple.iCal IncludeDebugMenu -bool true
### Reset to default value
defaults delete com.apple.iCal IncludeDebugMenu

Enable the debug menu in Disk Utility

### Read current value
defaults read com.apple.DiskUtility DUDebugMenuEnabled
defaults read com.apple.DiskUtility advanced-image-options
### Set to true
defaults write com.apple.DiskUtility DUDebugMenuEnabled -bool true
defaults write com.apple.DiskUtility advanced-image-options -bool true
### Reset to default value
defaults delete com.apple.DiskUtility DUDebugMenuEnabled
defaults delete com.apple.DiskUtility advanced-image-options

Auto-play videos when opened with QuickTime Player

### Read current value
defaults read com.apple.QuickTimePlayerX MGPlayMovieOnOpen
### Set to true
defaults write com.apple.QuickTimePlayerX MGPlayMovieOnOpen -bool true
### Reset to default value
defaults delete com.apple.QuickTimePlayerX MGPlayMovieOnOpen

Terminal & iTerm 2

Only use UTF-8 in Terminal.app

### Read current value
defaults read com.apple.terminal StringEncodings
### Set to 4
defaults write com.apple.terminal StringEncodings -array 4
### Reset to default value
defaults delete com.apple.terminal StringEncodings

Enable “focus follows mouse” for Terminal.app and all X11 apps i.e. hover over a window and start typing in it without clicking first

### Read current value
defaults read com.apple.terminal FocusFollowsMouse
defaults read org.x.X11 wm_ffm
### Set to true
defaults write com.apple.terminal FocusFollowsMouse -bool true
defaults write org.x.X11 wm_ffm -bool true
### Reset to default value
defaults delete com.apple.terminal FocusFollowsMouse
defaults delete org.x.X11 wm_ffm

Enable Secure Keyboard Entry in Terminal.app See: https://security.stackexchange.com/a/47786/8918

### Read current value
defaults read com.apple.terminal SecureKeyboardEntry
### Set to true
defaults write com.apple.terminal SecureKeyboardEntry -bool true
### Reset to default value
defaults delete com.apple.terminal SecureKeyboardEntry

Disable the annoying line marks

### Read current value
defaults read com.apple.Terminal ShowLineMarks
### Set to 0
defaults write com.apple.Terminal ShowLineMarks -int 0
### Reset to default value
defaults delete com.apple.Terminal ShowLineMarks

Don’t display the annoying prompt when quitting iTerm

### Read current value
defaults read com.googlecode.iterm2 PromptOnQuit
### Set to false
defaults write com.googlecode.iterm2 PromptOnQuit -bool false
### Reset to default value
defaults delete com.googlecode.iterm2 PromptOnQuit

Miscellaneous

Help Menu position

### Read current value
defaults read com.apple.helpviewer DevMode
### Set to false (default value) - By default, the Help Menu is always-on-top
defaults write com.apple.helpviewer DevMode -bool false
### Reset to default value
defaults delete com.apple.helpviewer DevMode

Enable spring loading for all Dock items Drag a file over an icon in the Dock, hover, and the application will open. The behaviour is unchanged if the app is already open.

### Read current value
defaults read com.apple.dock "enable-spring-load-actions-on-all-items"
### Set to false (default value) - Spring loading is disabled for Dock items.
defaults write com.apple.dock "enable-spring-load-actions-on-all-items" -bool "false" && killall Dock
### Reset to default value
defaults delete com.apple.dock "enable-spring-load-actions-on-all-items" && killall Dock

Show indicator lights for open applications in the Dock

### Read current value
defaults read com.apple.dock show-process-indicators
### Set to true
defaults write com.apple.dock show-process-indicators -bool true && killall Dock
### Reset to default value
defaults delete com.apple.dock show-process-indicators && killall Dock

Wipe all (default) app icons from the Dock This is only really useful when setting up a new Mac, or if you don’t use the Dock to launch apps.

### Read current value
defaults read com.apple.dock persistent-apps
### Set to true
defaults write com.apple.dock persistent-apps -array && killall Dock
### Reset to default value
defaults delete com.apple.dock persistent-apps && killall Dock

Show Music song notifications

### Read current value
defaults read com.apple.Music "userWantsPlaybackNotifications"
### Set to false (default value) - Notifications will not be displayed.
defaults write com.apple.Music "userWantsPlaybackNotifications" -bool "false" && killall Music
### Reset to default value
defaults delete com.apple.Music "userWantsPlaybackNotifications" && killall Music

General UI/UX

Disable transparency in the menu bar and elsewhere on Yosemite

### Read current value
defaults read com.apple.universalaccess reduceTransparency
### Set to true
defaults write com.apple.universalaccess reduceTransparency -bool true
### Reset to default value
defaults delete com.apple.universalaccess reduceTransparency

Set highlight color

### Read current value
defaults read NSGlobalDomain AppleHighlightColor
### Set to green
defaults write NSGlobalDomain AppleHighlightColor -string "0.764700 0.976500 0.568600"
### Reset to default value
defaults delete NSGlobalDomain AppleHighlightColor

Always show scrollbars Possible values: * WhenScrolling * Automatic * Always

### Read current value
defaults read NSGlobalDomain AppleShowScrollBars
### Set to "Always"
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
### Reset to default value
defaults delete NSGlobalDomain AppleShowScrollBars

Disable the over-the-top focus ring animation

### Read current value
defaults read NSGlobalDomain NSUseAnimatedFocusRing
### Set to false
defaults write NSGlobalDomain NSUseAnimatedFocusRing -bool false
### Reset to default value
defaults delete NSGlobalDomain NSUseAnimatedFocusRing

Adjust toolbar title rollover delay

### Read current value
defaults read NSGlobalDomain NSToolbarTitleViewRolloverDelay
### Set to 0
defaults write NSGlobalDomain NSToolbarTitleViewRolloverDelay -float 0
### Reset to default value
defaults delete NSGlobalDomain NSToolbarTitleViewRolloverDelay

Increase window resize speed for Cocoa applications

### Read current value
defaults read NSGlobalDomain NSWindowResizeTime
### Set to 0.001
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
### Reset to default value
defaults delete NSGlobalDomain NSWindowResizeTime

Expand save panel by default

### Read current value
defaults read NSGlobalDomain NSNavPanelExpandedStateForSaveMode
defaults read NSGlobalDomain NSNavPanelExpandedStateForSaveMode2
### Set to true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
### Reset to default value
defaults delete NSGlobalDomain NSNavPanelExpandedStateForSaveMode
defaults delete NSGlobalDomain NSNavPanelExpandedStateForSaveMode2

Expand print panel by default

### Read current value
defaults read NSGlobalDomain PMPrintingExpandedStateForPrint
defaults read NSGlobalDomain PMPrintingExpandedStateForPrint2
### Set to true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
### Reset to default value
defaults delete NSGlobalDomain PMPrintingExpandedStateForPrint
defaults delete NSGlobalDomain PMPrintingExpandedStateForPrint2

Automatically quit printer app once the print jobs complete

### Read current value
defaults read com.apple.print.PrintingPrefs "Quit When Finished"
### Set to true
defaults write com.apple.print.PrintingPrefs "Quit When Finished" -bool true
### Reset to default value
defaults delete com.apple.print.PrintingPrefs "Quit When Finished"

Disable the “Are you sure you want to open this application?” dialog

### Read current value
defaults read com.apple.LaunchServices LSQuarantine
### Set to false
defaults write com.apple.LaunchServices LSQuarantine -bool false
### Reset to default value
defaults delete com.apple.LaunchServices LSQuarantine

Display ASCII control characters using caret notation in standard text views Try e.g. cd /tmp; unidecode "\x{0000}" > cc.txt; open -e cc.txt

### Read current value
defaults read NSGlobalDomain NSTextShowsControlCharacters
### Set to true
defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
### Reset to default value
defaults delete NSGlobalDomain NSTextShowsControlCharacters

Disable Resume system-wide

### Read current value
defaults read com.apple.systempreferences NSQuitAlwaysKeepsWindows
### Set to false
defaults write com.apple.systempreferences NSQuitAlwaysKeepsWindows -bool false
### Reset to default value
defaults delete com.apple.systempreferences NSQuitAlwaysKeepsWindows

Disable automatic termination of inactive apps

### Read current value
defaults read NSGlobalDomain NSDisableAutomaticTermination
### Set to true
defaults write NSGlobalDomain NSDisableAutomaticTermination -bool true
### Reset to default value
defaults delete NSGlobalDomain NSDisableAutomaticTermination

Disable the crash reporter

### Read current value
defaults read com.apple.CrashReporter DialogType
### Set to "none"
defaults write com.apple.CrashReporter DialogType -string "none"
### Reset to default value
defaults delete com.apple.CrashReporter DialogType

Reveal IP address, hostname, OS version, etc. when clicking the clock in the login window

### Read current value
defaults read /Library/Preferences/com.apple.loginwindow
### Set to true
sudo defaults write /Library/Preferences/com.apple.loginwindow AdminHostInfo HostName
### Reset to default value
sudo defaults delete /Library/Preferences/com.apple.loginwindow AdminHostInfo

Disable automatic capitalization

### Read current value
defaults read NSGlobalDomain NSAutomaticCapitalizationEnabled
### Set to false
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
### Reset to default value
defaults delete NSGlobalDomain NSAutomaticCapitalizationEnabled

Disable smart dashes

### Read current value
defaults read NSGlobalDomain NSAutomaticDashSubstitutionEnabled
### Set to false
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
### Reset to default value
defaults delete NSGlobalDomain NSAutomaticDashSubstitutionEnabled

Disable automatic period substitution

### Read current value
defaults read NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled
### Set to false
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
### Reset to default value
defaults delete NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled

Disable smart quotes

### Read current value
defaults read NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled
### Set to false
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
### Reset to default value
defaults delete NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled

Disable auto-correct

### Read current value
defaults read NSGlobalDomain NSAutomaticSpellingCorrectionEnabled
### Set to false
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
### Reset to default value
defaults delete NSGlobalDomain NSAutomaticSpellingCorrectionEnabled

Trackpad, mouse, keyboard, Bluetooth accessories, and input

Trackpad: enable tap to click for this user and for the login screen

### Read current value
defaults read com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking
defaults -currentHost read NSGlobalDomain com.apple.mouse.tapBehavior
defaults read NSGlobalDomain com.apple.mouse.tapBehavior
### Set to true
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
### Set to 1
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
### Set to 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
### Reset to default value
defaults delete com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking
defaults -currentHost delete NSGlobalDomain com.apple.mouse.tapBehavior
defaults delete NSGlobalDomain com.apple.mouse.tapBehavior

Trackpad: map bottom right corner to right-click

### Read current value
defaults read com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick
defaults read com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick
defaults -currentHost read NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior
defaults -currentHost read NSGlobalDomain com.apple.trackpad.enableSecondaryClick
### Set to 
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick -int 2
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick -bool true
defaults -currentHost write NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior -int 1
defaults -currentHost write NSGlobalDomain com.apple.trackpad.enableSecondaryClick -bool true
### Reset to default value
defaults delete com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadCornerSecondaryClick
defaults delete com.apple.driver.AppleBluetoothMultitouch.trackpad TrackpadRightClick
defaults -currentHost delete NSGlobalDomain com.apple.trackpad.trackpadCornerClickBehavior
defaults -currentHost delete NSGlobalDomain com.apple.trackpad.enableSecondaryClick

Disable “natural” (Lion-style) scrolling

### Read current value
defaults read NSGlobalDomain com.apple.swipescrolldirection
### Set to false
defaults write NSGlobalDomain com.apple.swipescrolldirection -bool false
### Reset to default value
defaults delete NSGlobalDomain com.apple.swipescrolldirection

Increase sound quality for Bluetooth headphones/headsets

### Read current value
defaults read com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)"
### Set to 40
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
### Reset to default value
defaults delete com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)"

Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)

### Read current value
defaults read NSGlobalDomain AppleKeyboardUIMode
### Set to 3
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
### Reset to default value
defaults delete NSGlobalDomain AppleKeyboardUIMode

Use scroll gesture with the Ctrl (^) modifier key to zoom

### Read current value
defaults read com.apple.universalaccess closeViewScrollWheelToggle
defaults read com.apple.universalaccess HIDScrollZoomModifierMask
### Set to
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
### Reset to default value
defaults delete com.apple.universalaccess closeViewScrollWheelToggle
defaults delete com.apple.universalaccess HIDScrollZoomModifierMask

Follow the keyboard focus while zoomed in

### Read current value
defaults read com.apple.universalaccess closeViewZoomFollowsFocus
### Set to true
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
### Reset to default value
defaults delete com.apple.universalaccess closeViewZoomFollowsFocus

Disable press-and-hold for keys in favor of key repeat

### Read current value
defaults read NSGlobalDomain ApplePressAndHoldEnabled
### Set to false
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
### Reset to default value
defaults delete NSGlobalDomain ApplePressAndHoldEnabled

Set a blazingly fast keyboard repeat rate

### Read current value
defaults read NSGlobalDomain KeyRepeat
defaults read NSGlobalDomain InitialKeyRepeat
### Set to 
defaults write NSGlobalDomain KeyRepeat -int 1
defaults write NSGlobalDomain InitialKeyRepeat -int 10
### Reset to default value
defaults delete NSGlobalDomain KeyRepeat
defaults delete NSGlobalDomain InitialKeyRepeat

Set language and text formats

### Read current value
defaults read NSGlobalDomain AppleLanguages
defaults read NSGlobalDomain AppleLocale
defaults read NSGlobalDomain AppleMeasurementUnits
defaults read NSGlobalDomain AppleMetricUnits
### Set to 
defaults write NSGlobalDomain AppleLanguages -array "en-US" "pl-US"
defaults write NSGlobalDomain AppleLocale -string "en_US@currency=USD"
defaults write NSGlobalDomain AppleMeasurementUnits -string "Inches"
defaults write NSGlobalDomain AppleMetricUnits -bool false
### Reset to default value
defaults delete NSGlobalDomain AppleLanguages
defaults delete NSGlobalDomain AppleLocale
defaults delete NSGlobalDomain AppleMeasurementUnits
defaults delete NSGlobalDomain AppleMetricUnits

Show language menu in the top right corner of the boot screen

### Read current value
defaults read /Library/Preferences/com.apple.loginwindow showInputMenu
### Set to false
sudo defaults write /Library/Preferences/com.apple.loginwindow showInputMenu -bool true
### Reset to default value
sudo defaults delete /Library/Preferences/com.apple.loginwindow showInputMenu

Screen

Require password immediately after sleep or screen saver begins

### Read current value
defaults read com.apple.screensaver askForPassword
defaults read com.apple.screensaver askForPasswordDelay
### Set to 
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
### Reset to default value
defaults delete com.apple.screensaver askForPassword
defaults delete com.apple.screensaver askForPasswordDelay

Enable subpixel font rendering on non-Apple LCDs Reference: https://github.com/kevinSuttle/macOS-Defaults/issues/17#issuecomment-266633501

### Read current value
defaults read NSGlobalDomain AppleFontSmoothing
### Set to 1
defaults write NSGlobalDomain AppleFontSmoothing -int 1
### Reset to default value
defaults delete NSGlobalDomain AppleFontSmoothing

Enable HiDPI display modes (requires restart)

### Read current value
defaults read /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled
### Set to 1
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
### Reset to default value
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled

Mac App Store

Enable the WebKit Developer Tools in the Mac App Store

### Read current value
defaults read com.apple.appstore WebKitDeveloperExtras
### Set to true
defaults write com.apple.appstore WebKitDeveloperExtras -bool true
### Reset to default value
defaults delete com.apple.appstore WebKitDeveloperExtras

Enable Debug Menu in the Mac App Store

### Read current value
defaults read com.apple.appstore ShowDebugMenu
### Set to true
defaults write com.apple.appstore ShowDebugMenu -bool true
### Reset to default value
defaults delete com.apple.appstore ShowDebugMenu

Enable the automatic update check

### Read current value
defaults read com.apple.SoftwareUpdate AutomaticCheckEnabled
### Set to true
defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
### Reset to default value
defaults delete com.apple.SoftwareUpdate AutomaticCheckEnabled

Check for software updates daily, not just once per week

### Read current value
defaults read com.apple.SoftwareUpdate ScheduleFrequency
### Set to 1
defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
### Reset to default value
defaults delete com.apple.SoftwareUpdate ScheduleFrequency

Download newly available updates in background

### Read current value
defaults read com.apple.SoftwareUpdate AutomaticDownload
### Set to 1
defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1
### Reset to default value
defaults delete com.apple.SoftwareUpdate AutomaticDownload

Install System data files & security updates

### Read current value
defaults read com.apple.SoftwareUpdate CriticalUpdateInstall
### Set to 1
defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1
### Reset to default value
defaults delete com.apple.SoftwareUpdate CriticalUpdateInstall

Automatically download apps purchased on other Macs

### Read current value
defaults read com.apple.SoftwareUpdate ConfigDataInstall
### Set to 1
defaults write com.apple.SoftwareUpdate ConfigDataInstall -int 1
### Reset to default value
defaults delete com.apple.SoftwareUpdate ConfigDataInstall

Turn on app auto-update

### Read current value
defaults read com.apple.commerce AutoUpdate
### Set to true
defaults write com.apple.commerce AutoUpdate -bool true
### Reset to default value
defaults delete com.apple.commerce AutoUpdate

Allow the App Store to reboot machine on macOS updates

### Read current value
defaults read com.apple.commerce AutoUpdateRestartRequired
### Set to true
defaults write com.apple.commerce AutoUpdateRestartRequired -bool true
### Reset to default value
defaults delete com.apple.commerce AutoUpdateRestartRequired

Photos

Prevent Photos from opening automatically when devices are plugged in

### Read current value
defaults -currentHost read com.apple.ImageCapture disableHotPlug
### Set to true
defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
### Reset to default value
defaults -currentHost delete com.apple.ImageCapture disableHotPlug

Messages

Disable automatic emoji substitution (i.e. use plain text smileys)

### Read current value
defaults read com.apple.messageshelper.MessageController SOInputLineSettings
### Set to false
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
### Reset to default value
defaults delete com.apple.messageshelper.MessageController SOInputLineSettings

Disable smart quotes as it’s annoying for messages that contain code

### Read current value
defaults read com.apple.messageshelper.MessageController SOInputLineSettings
### Set to false
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
### Reset to default value
defaults delete com.apple.messageshelper.MessageController SOInputLineSettings

Disable continuous spell checking

### Read current value
defaults read com.apple.messageshelper.MessageController SOInputLineSettings
### Set to false
defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false
### Reset to default value
defaults delete com.apple.messageshelper.MessageController SOInputLineSettings

Google Chrome & Google Chrome Canary

Disable the all too sensitive backswipe on trackpads

### Read current value
defaults read com.google.Chrome AppleEnableSwipeNavigateWithScrolls
defaults read com.google.Chrome.canary AppleEnableSwipeNavigateWithScrolls
### Set to false
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
defaults write com.google.Chrome.canary AppleEnableSwipeNavigateWithScrolls -bool false
### Reset to default value
defaults delete com.google.Chrome AppleEnableSwipeNavigateWithScrolls
defaults delete com.google.Chrome.canary AppleEnableSwipeNavigateWithScrolls

Disable the all too sensitive backswipe on Magic Mouse

### Read current value
defaults read com.google.Chrome AppleEnableMouseSwipeNavigateWithScrolls
defaults read com.google.Chrome.canary AppleEnableMouseSwipeNavigateWithScrolls
### Set to false
defaults write com.google.Chrome AppleEnableMouseSwipeNavigateWithScrolls -bool false
defaults write com.google.Chrome.canary AppleEnableMouseSwipeNavigateWithScrolls -bool false
### Reset to default value
defaults delete com.google.Chrome AppleEnableMouseSwipeNavigateWithScrolls
defaults delete com.google.Chrome.canary AppleEnableMouseSwipeNavigateWithScrolls

Use the system-native print preview dialog

### Read current value
defaults read com.google.Chrome DisablePrintPreview
defaults read com.google.Chrome.canary DisablePrintPreview
### Set to true
defaults write com.google.Chrome DisablePrintPreview -bool true
defaults write com.google.Chrome.canary DisablePrintPreview -bool true
### Reset to default value
defaults delete com.google.Chrome DisablePrintPreview
defaults delete com.google.Chrome.canary DisablePrintPreview

Expand the print dialog by default

### Read current value
defaults read com.google.Chrome PMPrintingExpandedStateForPrint2
defaults read com.google.Chrome.canary PMPrintingExpandedStateForPrint2
### Set to true
defaults write com.google.Chrome PMPrintingExpandedStateForPrint2 -bool true
defaults write com.google.Chrome.canary PMPrintingExpandedStateForPrint2 -bool true
### Reset to default value
defaults delete com.google.Chrome PMPrintingExpandedStateForPrint2
defaults delete com.google.Chrome.canary PMPrintingExpandedStateForPrint2

GPGMail 2

Disable signing emails by default

### Read current value
defaults read ~/Library/Preferences/org.gpgtools.gpgmail SignNewEmailsByDefault
### Set to false
defaults write ~/Library/Preferences/org.gpgtools.gpgmail SignNewEmailsByDefault -bool false
### Reset to default value
defaults delete ~/Library/Preferences/org.gpgtools.gpgmail SignNewEmailsByDefault