What is a .DS_Store file?

.DS_Store (Desktop Services Store) is a hidden file that Finder automatically creates inside almost every folder you open on a Mac. It stores folder-specific display settings - icon positions, window size, view mode (icons, list, or columns), and background color - so the folder looks the same the next time you open it.

Why do I have so many .DS_Store files?

Finder writes one .DS_Store file per folder, the moment you browse into it. If you've used your Mac for years and opened thousands of folders across your Documents, Downloads, and external drives, you likely have thousands of these tiny files scattered everywhere - most just a few kilobytes each.

Is it safe to delete .DS_Store files?

Yes. Deleting a .DS_Store file causes no harm - Finder simply recreates it the next time you open that folder, using default view settings. You won't lose any documents or data, only the folder's remembered icon layout and view preferences.

How do I see .DS_Store files in Finder?

They're hidden by default. Press Cmd+Shift+. (period) in Finder to toggle hidden files on and off, or open Terminal and run defaults write com.apple.finder AppleShowAllFiles YES followed by killall Finder.

How do I remove .DS_Store files in bulk?

In Terminal, run this from your home folder to delete every .DS_Store file in your user directory:

find ~ -name '.DS_Store' -type f -delete

They'll quietly reappear as you continue browsing folders in Finder - that's expected behavior, not a bug.

Can I stop macOS from creating .DS_Store files?

You can disable them on network and external drives, which is the most common annoyance (since a .DS_Store file left on a USB drive or shared folder can look messy on other systems):

defaults write com.apple.desktopservices DSDontWriteNetworkStores true
defaults write com.apple.desktopservices DSDontWriteUSBStores true

You can't fully disable them on your local internal drive without side effects, since Finder relies on them for per-folder view settings.

Why do .DS_Store files show up in my code repository?

If you use git and browse project folders in Finder, .DS_Store files can get accidentally committed. Add .DS_Store to your global .gitignore to stop this permanently: git config --global core.excludesfile ~/.gitignore_global, then add .DS_Store to that file.

Do .DS_Store files take up meaningful storage?

Individually, no - each is typically a few KB. Across a drive with hundreds of thousands of folders (common on developer machines or old backup drives), they can add up to tens of megabytes, which is negligible compared to caches, duplicate files, or large old files. If you're chasing real storage gains, DustByte's Large & Old Files and Duplicate Finder tools target the files actually worth reclaiming space from.