macOS

What Are .DS_Store Files and Where Do They Live?

Why Finder drops .DS_Store in every folder, the network share annoyance, and safe cleanup commands.

Last updated

Finder writes a .DS_Store file into every folder you open, recording icon positions, view options and sort order. They are invisible by default and harmless locally, which is why most Mac users never notice them.

They turn annoying on shared drives and in code repos, where Windows users and git see clutter Mac owners cannot. macOS can skip writing them on network volumes with one defaults command. Deleting existing ones is safe; Finder recreates each file the next time you open its folder.

Where macOS stores this, by platform

macOS
~/.DS_Store

Example instance; one hides in nearly every Finder folder including Desktop. Stop network ones with defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE. Sweep strays with find and -name .DS_Store -delete.

Frequently asked questions

Is it safe to delete .DS_Store files?

Yes. They hold only folder view preferences, so Finder rebuilds each one on next visit. Repos and release zips stay cleaner without them, which is why many projects gitignore the name.

How do I stop .DS_Store files on network shares?

Run defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE, then relog. Local folders keep using them, but shared volumes stay clean for everyone else.

Notice an outdated path? Let us know.