Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Clean up those .DS_store files

Here are a few bits of info regarding .DS_Store files on Mac OSX. What they are:

The .DS_Store file is used to store metadata for icon information and are only created when using the gui to browse the file system.

Ways of removing them:

One time removal:

$ sudo find / -name ".DS_Store" -depth -exec rm {} \;

Periodic removal, stick it in cron. My fav.

$ sudo crontab -e
$ 15 1 * * * root find / -name ".DS_Store" -depth -exec rm {} \;

This will run daily at 1:15am, if the computer is on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment