macOS creates AppleDouble (._*) and .DS_Store files on volumes that don’t natively support macOS metadata (extended attributes and resource forks). Two defaults keys tell Finder to skip writing them.
Network volumes#
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE
killall Finder
Log out and back in if Finder restart alone isn’t enough.
To revert:
defaults delete com.apple.desktopservices DSDontWriteNetworkStores
killall FinderUSB and external drives#
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool TRUE
killall FinderRemove existing files#
These settings only prevent new files — existing ones stay until removed:
find /path/to/share -name '._*' -delete
find /path/to/share -name '.DS_Store' -deleteCaveat#
This suppresses most cases but is not a universal guarantee. macOS writes AppleDouble files whenever it needs to store metadata on a filesystem that doesn’t support native extended attributes. Some apps or copy operations can still produce them regardless of this setting.