The command: ```bash defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true ``` is a macOS Terminal...

August 27, 2025 at 02:58 AM

defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

The command:

defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

is a macOS Terminal command that modifies system preferences to prevent macOS Finder from creating .DS_Store files on USB drives or network drives (external storage). Here's what each part does:

  1. defaults write: This allows you to modify macOS system preferences and application-specific property lists.
  2. com.apple.desktopservices: This is the domain (or preference file) related to Finder.
  3. DSDontWriteUSBStores: This is the specific key in the com.apple.desktopservices domain that disables the writing of .DS_Store files to external drives when set.
  4. -bool true: This sets the key (DSDontWriteUSBStores) to boolean true or "enabled".

What are .DS_Store files?

.DS_Store files are hidden files that macOS Finder uses to store metadata and preferences (like view settings and icon positions) for each folder.

Effect of the Command

By running this command, macOS Finder is configured to stop creating .DS_Store files on USB drives (or network drives, in some cases). This is useful to avoid cluttering external drives with unnecessary hidden files, especially when sharing them with non-macOS systems.

To apply the change

After running the command, you may need to restart Finder for changes to take effect. You can do so with the command:

killall Finder

To undo the change

If you want to allow Finder to write .DS_Store files again, you can revert the setting by running:

defaults write com.apple.desktopservices DSDontWriteUSBStores -bool false

And restart Finder again if necessary.

Generate your own explanations
Download our vscode extension
Read other generated explanations

Built by @thebuilderjr
Sponsored by beam analytics
Read our terms and privacy policy
Forked from openai-quickstart-node