How to Use the macOS defaults Command to Change Hidden System Settings

What is the defaults Command?

macOS is heavily reliant on Property List (.plist) files to store system preferences and application configurations. While Apple provides a clean graphical interface (System Settings) to modify the most common preferences, hundreds of advanced settings are completely hidden from the average user. Apple hides these settings to prevent inexperienced users from breaking their systems, but power users often want access to them.

The defaults command is a powerful Terminal utility that allows you to read, write, and delete macOS preference keys directly. By using defaults write, you can enable secret features, change system behaviors, and customize your Mac in ways that are impossible through the standard graphical interface.

Step 1: Open the Terminal

To use the defaults command, you must use the command line.

  1. Press Command + Space to open Spotlight Search.
  2. Type Terminal and hit Enter.

Step 2: Examples of Useful defaults Commands

When you use the defaults write command, you must specify the domain (the application you are targeting, such as com.apple.finder), the specific key you want to change, the data type (usually a boolean true/false or an integer), and the new value.

Here are three highly popular hidden settings you can change right now:

1. Show Hidden Files in Finder

By default, macOS hides system files (any file starting with a dot, like .bash_profile). To permanently force Finder to show all hidden files, run:

defaults write com.apple.finder AppleShowAllFiles -bool true

(To revert this, change true to false).

2. Disable the Desktop Drop Shadow on Screenshots

When you press Command + Shift + 4 and hit the Spacebar to capture a specific window, macOS automatically adds a large, aesthetic drop shadow around the final image. This is annoying if you are creating clean documentation. To disable the shadow, run:

defaults write com.apple.screencapture disable-shadow -bool true

3. Change the Default Screenshot Save Location

macOS dumps all screenshots directly onto your Desktop, which quickly creates a massive, cluttered mess. To force the system to save screenshots to a different folder (for example, a folder named “Screenshots” inside your Documents folder), run:

defaults write com.apple.screencapture location ~/Documents/Screenshots

Step 3: Restarting the Associated Application

When you use the defaults command, you are essentially editing a text file in the background. If the application (like Finder or the Dock) is currently running, it will not instantly realize the underlying text file has changed. You must force the application to restart to read the new settings.

If you changed a Finder setting, run:

killall Finder

If you changed a Dock setting, run:

killall Dock

If you changed a system-wide setting (like the screenshot location), the killall SystemUIServer command usually applies it, but a full system reboot is the safest way to ensure the new preferences take effect.

How to Safely Delete a Modified Preference

If you run a defaults write command and you hate the result, you can usually revert it by running the exact same command but changing true to false.

However, the cleanest way to revert a hidden setting is to completely delete the custom key you just created, forcing macOS to fall back to its factory default behavior. You do this using the delete argument.

For example, to undo the hidden files setting and restore the factory default, run:

defaults delete com.apple.finder AppleShowAllFiles

Followed by a killall Finder.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.