Asepsis - Get rid of those annoying .DS_Store


.DS_Store (short for Desktop Services Store) is a hidden file with a proprietary format created by OS X to store custom attributes of a folder such as the position of icons or the choice of a background image.

By default, Finder creates a .DS_Store file in every folder that it accesses, even folders on remote systems (for example, folders shared over an SMB or AFP connection). This is in contrast with the previous versions of Finder, which would merely place a number of invisible files at the root of the volume being accessed, always storing the settings and metadata for all of the folders in the entire volume within this single set of files.

Network Drives

It’s possible to stop MacOS from writing DS_Store on network drives with an easy terminal command:

defaults write DSDontWriteNetworkStores true

It’s fully supported by Apple (more instructions can be found HERE) and it will stop pissing off any Windows user sharing your network drives.

Local Drives

Preventing the creation of these annoying garbage files in local drives is more complex, but thanks to a very talented developer there is a nice solution for this too.

It’s called Asepsis and it works by interposing some library calls used by OsX to access .DS_Store files. Interposed functions detect paths talking about .DS_Store files and redirect them into a special prefix folder.

My advice for the installation of the utility is:

  1. Backup your hard drive with TimeMachine (or similar).
  2. Run the Installer
  3. Restart the Computer
  4. Delete all the old DS_Store file with the terminal command:
    sudo find / -name ".DS_Store" -depth -exec rm {} ;

    COPY AND PASTE the string above, because any error could lead to devastating consequences;
    enter the administrator password when asked (it won’t be visible when typing).