Removing pesky .DS_Store files from network fileshares

2014-10-15 21:39 PDT

When a Macintosh computer writes to a network fileshare it leaves pesky “.DS-Store” files all over the place. These files contain a bunch of meta-data about the state of the directory when viewed by the Mac; things like what view was last used (icon or column, sort order, etc). Ultimately they are harmless, they take up very little space, they are invisible to Mac users and most Linux users alike. But the Windows people tend to get all up on their soapboxes about the Mac littering these files all over their file systems (never mind the “Thumbs DB” files that Windows leaves behind).

Below is a script that I put together a few weeks ago, that can be run from a Mac (or a Linux machine) that will recursively remove all the .DS_Store files. This can be handy before packaging a collection of files.