What Is .DS_Store, Can You Delete It, and What Does It Reveal
A .DS_Store file holds the Mac Finder's view settings for one folder — icon positions, view mode, window size. It is created automatically, it is safe to delete, and it lists every file Finder saw in that folder, which is why it matters when it leaves the Mac.
Why it will not open
- It is not meant to be opened. Finder reads and writes it silently; no application opens a .DS_Store as a document, and on Windows it is just an unknown file with a strange name.
- It is a binary database, not text. Opening it in an editor shows fragments of file names between unreadable bytes — the names are real, the structure around them is a B-tree of Finder records.
- It follows the folder. Copy or zip a folder on a Mac and the .DS_Store comes along; upload the folder to a web server or commit it to Git and it is published with everything else.
How to open it
See what it records
- 1 On a Mac, press Command + Shift + . (period) in Finder to show hidden files; on Windows, tick View → Hidden items. The file is named exactly .DS_Store.
- 2 Drop it into the viewer on this site. It lists every file and folder name recorded and each attribute Finder stored for it.
- 3 Nothing is uploaded — the point of checking is that it might name things you would rather not share.
Remove it and keep it out of Git
- 1 Delete it. Finder recreates it on the Mac when the folder is next opened; elsewhere it is simply gone.
- 2 In a Git repository: add ".DS_Store" to .gitignore, run "git rm --cached .DS_Store" (with -r for nested ones), commit and push.
- 3 To ignore it in every repository on the Mac, add it to a global ignore file: git config --global core.excludesfile ~/.gitignore_global, then put .DS_Store in that file.
Stop the Mac writing it to network drives
- 1 In Terminal: defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true, then log out and back in. Finder stops creating .DS_Store on network volumes (local folders still get them).
- 2 For USB drives: defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true.
What it does and does not contain
File names, icon positions, view settings, sometimes Spotlight comments and, on some versions, sizes and dates. It does not contain file contents, passwords or account details. The exposure is the listing itself: a .DS_Store on a web server is a directory index the server never meant to publish.
Why Windows users keep seeing it
Every folder a Mac user browsed on the shared drive gets one. They are harmless on Windows and can be deleted; the Mac will make new ones unless the network-store setting above is applied on the Mac.