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
- Open Terminal (Applications → Utilities).
- Run a command in the form
defaults write <domain> <key> -<type> <value>, for exampledefaults write com.apple.dock autohide-delay -float 0. - Restart the app that owns the setting, for example
killall Dockorkillall Finder, so that it reads the new value. - 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:
| Part | Example | Meaning |
|---|---|---|
| Domain | com.apple.dock | The app or system area that owns the setting. NSGlobalDomain (or -g) applies to all apps. |
| Key | autohide | The name of the setting. |
| Type | -bool | The kind of value: -bool, -int, -float, -string, -array or -dict. |
| Value | true | What 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
- Nothing changed: restart the app that owns the setting (
killall Dock,killall Finder,killall SystemUIServer), or log out and back in for global settings. - Apple changed the key: hidden settings are not documented, and Apple can rename, move or ignore them in any release. A command that worked on one macOS version may do nothing on another.
- The app is sandboxed or protected: some apps, such as Safari, keep their preferences in a protected container, and Terminal may need Full Disk Access before it can change them. Settings guarded by System Integrity Protection cannot be changed this way.
- A typo in the domain:
defaultscreates a new, unused domain without any error, so check the spelling withdefaults read <domain> <key>.
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
- Mac Tweaks: change hidden macOS settings without Terminal
- How to disable Gatekeeper on macOS
- How to reset NVRAM on a Mac
Frequently Asked Questions
Got questions? We've got answers.



