.DS_Store (Desktop Services Store) files on the MacOS operating system are created by the
Finder application upon visiting a directory, and contain metadata associated with each directory. Such metadata could include view settings, icon arragements, file sorting, etc.
To disable these annoying files enter the following command in Terminal:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
And to re-enable them:
defaults write com.apple.desktopservices DSDontWriteNetworkStores false
This command applies to the user-level, thus you will not be affecting other users on your Mac/network by entering the above command(s).