Skip to content
← All guides

System Data

What Are .DS_Store Files? Safe to Delete?

The MacZentra team · Updated Dec 1, 2026 · 6 min read

A .DS_Store file (often searched as ds_store) is a small hidden file that Finder creates in a folder to remember how you view it: icon positions, sort order, window size and similar settings. It is safe to delete, because Finder rebuilds it, but removing it frees almost no space and resets that folder’s view. MacZentra's Junk Cleaner lists caches and logs with their sizes, and everything you remove goes to the Trash. It replaces hunting through hidden Library folders yourself. See Junk Cleaner or try MacZentra free.

What is a .DS_Store file?

The name stands for Desktop Services Store. Finder writes one into a folder after you open it and change how it looks, or sometimes just by browsing. It holds view settings for that folder, such as list or icon view, where icons sit, and how items are sorted. It does not contain your documents or photos, and it is typically only a few kilobytes.

The name starts with a dot, so Finder hides it. That is why most people only meet it on another computer, in a zip file, or in a code repository.

Why .DS_Store files show up on drives and shares

Finder writes them wherever you browse in it, not only on your startup disk. You will find them on:

  • External drives and USB sticks you opened on a Mac. On a Windows PC they appear as odd files you did not create.
  • Network shares from a NAS or a file server, where other people see them in shared folders.
  • Archives and project folders that you zip on a Mac, so the files travel with the content.
  • Downloads, Desktop and Documents subfolders you have customised.

How to see hidden files, including .DS_Store

The simplest Finder-safe method is a shortcut. Open the folder in Finder and press Command + Shift + . (the period key). Hidden items appear greyed out. Press it again to hide them. It changes only what Finder shows. It does not move or edit anything.

For a read-only look in Terminal, list one folder, including hidden items:

Terminal
ls -la ~/Desktop

To see all of them inside a folder tree without deleting anything, list the matches:

Terminal
find ~/Documents -maxdepth 3 -name ".DS_Store" -type f

This prints paths and nothing else. Replace ~/Documents with the folder you care about.

MacZentra Large Files view listing the biggest files first
Large Files sorts by size, which is where real space is. A .DS_Store file would sit near the bottom of any such list.

Because the name begins with a dot, the same rule applies to other items you may have seen in Finder only after the shortcut, such as .Trashes on external drives. Leave anything you do not recognise alone. Hidden does not mean junk, and some of those items are used by macOS to manage the drive.

Is it safe to delete .DS_Store?

Yes. Nothing breaks. The next time you open the folder in Finder it may create the file again and, if you deleted it, the folder goes back to default view settings. You lose custom icon positions or sort order for that folder, and nothing else.

It is worth removing in a few cases:

  • Before sending a folder or zip to someone on another system.
  • In a code project, where it clutters git status. Add .DS_Store to your .gitignore instead.
  • On a shared drive, where the files look like clutter to everyone else.

If you only want free space, skip them. A folder tree can hold thousands of these and still add up to less than one photo. Real space comes from big files, caches and old downloads. See how to find large files on a Mac and how to find duplicate files.

How to delete .DS_Store in one folder

  1. Press Command + Shift + . to show hidden files in the folder.
  2. Select the greyed-out .DS_Store and move it to the Trash.
  3. Hide hidden files again with the same shortcut and empty the Trash.

For a folder with many subfolders, preview first with the find command above, then decide.

Why Finder keeps recreating them

Finder saves view settings whenever you open a folder and move, sort or resize something. Delete the file and look at the folder again, and a new one can appear. That is not a sign of a virus or a fault. It also means that mass-deleting these files is a chore with no end, which is why a setting or an ignore rule is a better answer than a cleanup run.

If you share a Mac with other people or copy folders to drives often, a one-off cleanup is the sensible choice. Do it when you hand something over, and leave the rest alone.

Stop Mac creating .DS_Store on network drives

You can ask macOS not to write them to network shares. It is a per-user setting:

Terminal
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

Log out and back in afterwards. It only affects network locations, not your local disk or USB drives. To undo it, run the same command with false.

Hidden files like this are just one kind of clutter. If you are cleaning up after a hunt for what fills the disk, look at how to check storage on a Mac first, then Library Caches, log files and the Downloads folder. For a bigger plan, use free up space on a Mac. The system files you should not touch, like the ones in what is sleepimage on a Mac, are a different category.

Questions people ask

What is a .DS_Store file on Mac?

It is a hidden file Finder creates to save a folder’s view settings. It holds no personal content.

Is it safe to delete .DS_Store files?

Yes. Finder can recreate them, and the only loss is custom view settings for that folder.

How do I show hidden files on a Mac?

In Finder, press Command + Shift + .. Press it again to hide them.

Why do .DS_Store files appear on my USB drive or Windows PC?

Finder writes them to any drive or share you browse on a Mac. Windows does not use them, so they look like stray files there.

Do .DS_Store files take up space?

Almost none. Deleting them will not free noticeable storage.

Everything MacZentra can clean

Treemap and Sunburst disk maps, a duplicate finder, Developer Junk, a complete app uninstaller and more, in one native storage cleaner for Mac that’s 15.4 MB.

Explore all features →