Featured image of post Terminal Command to Disable and Stop Automatic Generation of .DS_Store in macOS

Terminal Command to Disable and Stop Automatic Generation of .DS_Store in macOS

We introduce a terminal command to prevent unnecessary '.DS_Store' files from being automatically generated on network drives, etc. in a macOS environment. Procedures to revert to original settings and restart Finder are also summarized.

The command to prevent the automatic generation of .DS_Store on macOS is as follows. Please execute it in the terminal.

1
defaults write com.apple.desktopservices DSDontWriteNetworkStores true

After executing the command, restart Finder.

1
killall Finder

To restore the setting, please run the following command.

1
defaults delete com.apple.desktopservices DSDontWriteNetworkStores false

As with the above, restart Finder after changing the setting.

1
killall Finder
Licensed under CC BY-NC-SA 4.0