How to Clear the macOS CoreFoundation Preferences Cache (cfprefsd) via Terminal

The Preferences Daemon

In macOS, whenever you change a setting—such as adjusting the tracking speed of your Magic Mouse, switching to Dark Mode, or altering the default font in the Notes app—that configuration is not saved immediately to the hard drive. Instead, macOS routes all application and system preferences through a centralized, high-performance background daemon called cfprefsd (CoreFoundation Preferences Daemon).

The cfprefsd process maintains a massive, rapid-access cache of every single .plist (Property List) file on the entire operating system inside the physical RAM. When an application launches, it queries cfprefsd for its settings rather than slowly reading the physical SSD. Periodically, the daemon commits these cached changes to the physical .plist files on the disk.

However, if the daemon’s RAM cache becomes desynchronized from the physical files—perhaps due to a hard system crash, or if a user attempts to manually edit a .plist file using a text editor without telling the daemon—the symptoms are chaotic. You might uncheck a setting in System Settings, close the window, reopen it, and find the setting is magically checked again. Applications might refuse to remember their window positions, or worse, the cfprefsd process might get stuck in an infinite loop, consuming 100% of a CPU core as it endlessly attempts to reconcile a corrupted property list. To fix this, you must forcefully purge the CoreFoundation cache and reset the daemon via the Terminal.

The Danger of Manual Deletion

In older versions of macOS (pre-Yosemite), administrators could fix corrupted preferences by simply navigating to ~/Library/Preferences/, deleting the offending .plist file, and restarting the application. This no longer works.

Because cfprefsd holds the master copy in RAM, if you delete a physical .plist file using Finder or the rm command, the daemon will simply recreate the file a few seconds later using the corrupted data stored in its memory cache. You must interact with the daemon directly.

Purging the Cache via Terminal

To safely clear the cache, you must use the native macOS defaults command, which communicates directly with the cfprefsd API, or forcefully terminate the daemon.

  1. Open the Terminal application.

Method 1: Resetting a Specific Application Cache

If only a single application (e.g., Apple Mail) is refusing to save its settings, you can instruct the daemon to instantly flush its specific cache and delete the underlying file.

# Instantly clears the RAM cache and deletes the plist for Apple Mail
defaults delete com.apple.mail

(Note: This will completely reset the application to its factory default settings).

Method 2: The Nuclear Option (Force Daemon Restart)

If the entire macOS interface is glitching, or if System Settings is refusing to save changes, the entire global cache is corrupted. You must forcefully terminate the daemon.

Because there are actually two instances of cfprefsd running simultaneously (one for the root system, one for your user profile), you must kill both.

# Kill the user-level daemon
killall cfprefsd

# Kill the system-level daemon (requires password)
sudo killall cfprefsd

Press Enter, type your Mac’s administrator password (the characters will remain invisible), and press Enter again.

The Reinitialization

macOS is entirely dependent on this daemon. The moment you execute the killall commands, the launchd subsystem will instantly respawn two brand new, fresh instances of cfprefsd in the background.

Because the RAM cache was completely annihilated, the new daemons will immediately reach out to the physical SSD, re-read the raw .plist files from /Library/Preferences/ and ~/Library/Preferences/, and rebuild a mathematically perfect, uncorrupted cache in the memory.

The 100% CPU usage will instantly drop to zero, and all system settings will immediately begin saving correctly, restoring perfect stability to the operating system environment.

Get the best tech tips delivered straight to your inbox.

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