macOS stores application and system preferences in property list (plist) files. The graphical System Settings app only exposes a fraction of the available settings. Hundreds of additional options—controlling Finder behaviour, Dock appearance, screenshot formats, and more—are hidden from the standard interface.
The defaults command in the macOS Terminal allows you to read, write, and delete these preference values directly. By mastering this command, you can unlock powerful customisations that are simply not available through the System Settings GUI.
Understanding the defaults Command
Every macOS application stores its preferences in a domain, which corresponds to its bundle identifier (e.g., com.apple.finder for Finder, com.apple.dock for the Dock). The defaults command reads and writes key-value pairs within these domains.
The basic syntax follows this pattern:
- Read a value:
defaults read <domain> <key> - Write a value:
defaults write <domain> <key> -<type> <value> - Delete a value:
defaults delete <domain> <key>
The -<type> flag specifies the data type of the value you are setting. Common types include -bool (TRUE/FALSE), -int (integer), -float (decimal number), and -string (text).
Practical Customisations
1. Show Hidden Files in Finder
By default, macOS hides files and folders that begin with a dot (like .gitignore or .zshrc) from the Finder window. You can force Finder to always display them:
defaults write com.apple.finder AppleShowAllFiles -bool TRUE
To apply the change, restart Finder:
killall Finder
2. Change the Screenshot File Format
macOS saves screenshots as PNG files by default. PNG files are lossless but can be very large. If you take many screenshots, switching to JPEG can save significant disk space:
defaults write com.apple.screencapture type -string "jpg"
Other supported values include pdf, tiff, gif, and bmp.
3. Remove the Auto-Hide Delay on the Dock
If you have configured your Dock to auto-hide, there is a slight animation delay before it reappears when you move your cursor to the bottom of the screen. You can eliminate this delay entirely for an instant response:
defaults write com.apple.dock autohide-delay -float 0
You can also speed up the slide-in animation itself:
defaults write com.apple.dock autohide-time-modifier -float 0.3
Restart the Dock to apply:
killall Dock
4. Disable the “Are You Sure You Want to Open This Application?” Warning
macOS Gatekeeper displays a quarantine warning every time you open an application downloaded from the internet for the first time. If you frequently install third-party software, this can become tedious:
defaults write com.apple.LaunchServices LSQuarantine -bool FALSE
Warning: Disabling this check removes a layer of security. Only do this if you are confident in your ability to identify trustworthy software sources.
5. Show the Full File Path in Finder’s Title Bar
By default, Finder’s title bar only shows the name of the current folder. You can make it display the complete directory path, which is extremely useful for navigation:
defaults write com.apple.finder _FXShowPosixPathInTitle -bool TRUE
Restart Finder to apply: killall Finder
Reading Current Preference Values
Before making changes, it is good practice to read the current value of a setting so you can revert it if needed.
To read a specific key:
defaults read com.apple.dock autohide-delay
To dump all the preferences for an entire application domain (useful for discovering available keys):
defaults read com.apple.finder
Reverting Changes
If a customisation does not behave as expected, you can revert it by deleting the key you wrote. This restores macOS to its factory default for that specific setting:
defaults delete com.apple.dock autohide-delay
Then restart the relevant application (killall Dock, killall Finder, etc.) to apply the reversion.