Quick answer

Open Terminal and run defaults write <domain> <key> -<type> <value>, for example defaults write com.apple.dock autohide-delay -float 0, then restart the app with killall Dock. Undo it with defaults delete <domain> <key>. Mac Tweaks offers 250+ of these settings as toggles.

The defaults write command changes hidden macOS settings that System Settings does not show: how fast the Dock hides, whether Finder shows hidden files, where screenshots are saved, how quickly a key repeats. This guide explains how the command works, lists the commands people use most, and shows how to undo each one. If you would rather not type commands, Mac Tweaks gives you the same kind of settings as toggles and sliders.

The basic steps

How to
  1. Open Terminal (Applications → Utilities).
  2. Run a command in the form defaults write <domain> <key> -<type> <value>, for example defaults write com.apple.dock autohide-delay -float 0.
  3. Restart the app that owns the setting, for example killall Dock or killall Finder, so that it reads the new value.
  4. To undo it, run defaults delete <domain> <key>.

How defaults write works

macOS stores app and system preferences in property list (plist) files, mostly in ~/Library/Preferences. The defaults command reads and edits those files for you. Every command has four parts:

PartExampleMeaning
Domaincom.apple.dockThe app or system area that owns the setting. NSGlobalDomain (or -g) applies to all apps.
KeyautohideThe name of the setting.
Type-boolThe kind of value: -bool, -int, -float, -string, -array or -dict.
ValuetrueWhat you want the setting to be.

Three related commands are worth knowing:

defaults read com.apple.dock autohide      # show the current value
defaults delete com.apple.dock autohide    # remove your change and return to the default
defaults domains | tr ',' '\n' | head      # list the domains on this Mac

Dock

# Auto-hide the Dock with no delay and a faster animation
defaults write com.apple.dock autohide -bool true
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0.4

# Change the icon size (in pixels)
defaults write com.apple.dock tilesize -int 40

# Hide recent apps
defaults write com.apple.dock show-recents -bool false

# Show only running apps
defaults write com.apple.dock static-only -bool true

# Turn off the app-opening bounce animation
defaults write com.apple.dock launchanim -bool false

# Use the scale effect instead of genie when minimizing
defaults write com.apple.dock mineffect -string "scale"

# Add a spacer tile to the Dock
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'

killall Dock

Finder

# Show hidden files
defaults write com.apple.finder AppleShowAllFiles -bool true

# Show all file extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true

# Show the path bar and status bar
defaults write com.apple.finder ShowPathbar -bool true
defaults write com.apple.finder ShowStatusBar -bool true

# Show the full POSIX path in the window title
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true

# Keep folders on top when sorting by name
defaults write com.apple.finder _FXSortFoldersFirst -bool true

# Use list view in all windows by default
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"

# Hide the icons on the Desktop
defaults write com.apple.finder CreateDesktop -bool false

# Turn off the warning when you change a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

# Do not create .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

killall Finder

Screenshots

# Save screenshots to a folder of your choice
mkdir -p ~/Pictures/Screenshots
defaults write com.apple.screencapture location ~/Pictures/Screenshots

# Save as JPG instead of PNG
defaults write com.apple.screencapture type -string "jpg"

# Remove the window shadow from window screenshots
defaults write com.apple.screencapture disable-shadow -bool true

# Skip the floating thumbnail after each screenshot
defaults write com.apple.screencapture show-thumbnail -bool false

killall SystemUIServer

Keyboard, windows and general behavior

# Faster key repeat (lower numbers are faster); log out and in to apply
defaults write NSGlobalDomain KeyRepeat -int 2
defaults write NSGlobalDomain InitialKeyRepeat -int 15

# Repeat a held key instead of showing the accent picker
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false

# Turn off automatic spelling correction
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false

# Always show scroll bars
defaults write NSGlobalDomain AppleShowScrollBars -string "Always"

# Expand the save dialog by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true

# Speed up window resizing in apps that honor it
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001

# Stop Spaces from rearranging themselves by recent use
defaults write com.apple.dock mru-spaces -bool false
killall Dock

# Make TextEdit open new documents as plain text
defaults write com.apple.TextEdit RichText -int 0

How to undo a defaults write command

Delete the key you changed and restart the app that owns it:

defaults delete com.apple.dock autohide-delay
killall Dock

Deleting a key returns that setting to the macOS default. To undo everything for one app, defaults delete com.apple.dock removes all of that domain's saved preferences, so use it with care. Before you experiment, back up a domain with defaults export com.apple.dock ~/Desktop/dock-backup.plist and restore it later with defaults import.

When a command does not work

Change hidden settings without Terminal

Mac Tweaks is a free Mac app that puts over 250 hidden defaults write settings into 18 categories, including the Dock, Finder, Mission Control, the menu bar, Mouse & Trackpad, Keyboard, Safari, Preview and Terminal. Each option has a short description, you can cancel a change before it is applied, and you can export your configuration to copy it to another Mac. It runs on macOS Big Sur 11 or later, on Intel and Apple Silicon.

Related guides

Frequently Asked Questions

Got questions? We've got answers.

What does defaults write do on a Mac?
It edits an app's or the system's preference (plist) file from Terminal. Many settings that System Settings does not show can be changed this way, such as the Dock auto-hide delay or showing hidden files in Finder.
How do I undo a defaults write command?
Run defaults delete with the same domain and key, then restart the app, for example defaults delete com.apple.dock autohide-delay followed by killall Dock. Deleting the key returns the setting to the macOS default.
Why did my defaults write command do nothing?
The app usually has to be restarted (killall Dock, killall Finder, killall SystemUIServer). Apple can also rename or ignore hidden keys between macOS versions, and sandboxed or protected apps may need Full Disk Access for Terminal.
Is defaults write safe?
Most commands only change a preference and can be reversed with defaults delete. Back up a domain first with defaults export, and avoid deleting a whole domain unless you mean to reset that app.
Is there a way to change hidden macOS settings without Terminal?
Yes. Mac Tweaks is a free Mac app with over 250 hidden settings in 18 categories, shown as toggles, sliders and dropdowns, with export and import of your configuration.