Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I manually delete a .DS_Store file from a directory, what's the worst that can happen? What important information might I lose?

share|improve this question
up vote 46 down vote accepted

.DS_Store files are only used by the Finder to hold custom view settings for that particular folder. In most cases nothing will happen if you delete them, or at worst custom Finder view settings (icon size, position, background color, etc) will be lost.

If you are trying to maintain a 'spatial Finder' experience in OS X, you might care more, but for most users no change will be noticed.

share|improve this answer
Not quite correct, comments are lost when deleting .DS_Store files! – akuhn Nov 12 '12 at 23:01
actually, the comments are still in the extended file attributes, but the Finder won't try to read from there. to see yourself: mdls -n kMDItemFinderComment myfile – mb21 Jun 28 '13 at 14:14

The worst that will happen is that folder display attributes (icon positions and view settings) will go away. If you don't consider icon positions and view settings important, there is no important information stored in these files, so it is safe to delete them.

share|improve this answer

As far as I can tell, they store all the settings shown in view options in icon and list view (or parts of the settings after some of them have been changed).

In column view the options at the bottom are the same for all folders, but the arrange by and sort by modes are still saved in .DS_Store files.

Always open in means "save the previously used view mode of this folder to a .DS_Store file". It overrides the default view mode (FXPreferredViewStyle, which is often changed after closing a window). If you check "Always open in column view" and press ⌘1, the folder-specific view mode becomes icon view.

.DS_Store files also contain the default dimensions of windows, the shown parts of windows, the positions of icons in icon view, and the width of the sidebar.

Spotlight comments are stored in both .DS_Store files and extended attributes. If you delete a .DS_Store file, Finder won't see the comments, but Spotlight will.

share|improve this answer
Anyway to recreate the DS_Store file (after its been deleted). In particular with comments from the extended attributes? – Matt Tagg Oct 2 '14 at 1:41

Since OS X 10.6 and so on, the format of .DS_Store changed from text into binary and it seems to be undocumented by Apple, therefore you really don't know the exact consequences of removing such files.

But based on the information that we have, the file is basically storing information about how it displays directories and files (e.g. its position in Finder). It holds a series of records giving attributes of the files in the directory or of the directory itself (referred to as .) in a B-tree like format.

It also stores from where the files were removed in Trash folder, so removing the DS_Store file from there, Finder won't know the original location of your removed files.

Therefore if you don't worry about how your folder is displayed in Finder, you can safely remove it. If it's DS_Store file within your Trash folder, better leave it.

If you're further interested what's exactly stored in DS_Store files, you may try to use tool which can read a store file's records in human-readable format.

See also: DS_Store Format at CPAN

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.