To stop your mac’s cluttering up network spaces with unsightly DS_Stores everywhere, the method has slightly changed since the Yosemite/EL Captain upgrade. the DS_Stores are especially a pain if you share network space with Windows users.
Simply open up terminal, and enter:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
Reboot your mac and all should be done! Next, if you want to easily remove old DS_Stores, CD into the folder to check and run the following commands
Find all the DS_Stores: sudo find -name '*.DS_Store' -type f
#Delete existing DS_Stores: sudo find -name '*.DS_Store' -type f -delete
I also recommend running the commands again for DS_STORE, Ds_Store, and other variants to check for any lingerers! After doing the above, you will enjoy much faster network speeds between macs on the network too. I also recommend running a Netatalk share in parallel to any Samba shares if you haven’t done already.