Disable and remove .DS_Store files stored on network locations

So today I was going through my Synology NAS and noticed .DS_Store files all over the place.

These are actually files containing extended attributes created by Finder in Mac OS X. But, since they get written out to network locations, they can cause backup and versionining issues.

To disable them from being created on network locations, open a Terminal and run the following

defaults write DSDontWriteNetworkStores true

(Note: This only affects the currently-logged-in user)

Now in my case, I had these files all over my Synology NAS, so I was able to easily get rid of them by SSHing into the box and running the following:

find / -name .DS_Store -delete

And… done.


, , , , ,

  1. #1 by Peter Venton on December 31, 2012 - 4:06 am

    Tried your suggestion and get a permission denied on the delete.

    I am not a unix expert – I often get an error about a DS_Store file already existing when trying to copy files from one NAS to another. I want to remove all the DS_Store files and prevent further creation.

    I am trying to copy gigabytes of data from an old NAS to a new one and simply cannot do it with the DS_Store files in place. I am the admin on my own machines and still get the permission denied error.

    Its very annoying

    • #2 by Mike on December 31, 2012 - 7:25 am

      Are you connected to the NAS as root? Where do you get the permission denied errors?

  2. #3 by Chris on March 15, 2013 - 10:43 am

    Thank you for this post. Very helpful for OS X user like me who was encountering problems with copying files from Synology NAS.