A .DS_Store file is a hidden folder created automatically by macOS to store display settings for that folder

Every folder on a Mac contains a .DS_Store file, though you won't see it unless you turn on the display of hidden files. The name stands for "Desktop Services Store," and the file holds information about how that folder should look — things like icon positions, view preferences, background images, and window size. macOS creates and updates these files whenever you open a folder or change how it displays.

These files are system files, not documents you create or edit yourself. They exist solely to remember your folder preferences. If you delete one, macOS simply creates a new one the next time you open that folder. They take up very little space — usually a few kilobytes each — but they can accumulate across your drive, especially if you work with many folders.

Key Takeaways

  • .DS_Store files are created by macOS in every folder to remember display settings like icon positions and view preferences.
  • These files are hidden by default and only appear if you enable the display of hidden files in Finder.
  • Deleting .DS_Store files is safe and causes no harm, though macOS will recreate them automatically.
  • .DS_Store files can cause problems when Mac folders are shared with Windows users or synced to cloud storage, because Windows does not recognize them.
  • You can prevent .DS_Store creation on external drives or network locations using Terminal commands.

Why .DS_Store files appear in shared folders and cloud storage

When you share a folder from your Mac with Windows users, or when you sync a Mac folder to cloud storage like Dropbox or Google Drive, the .DS_Store files go along with it. Windows computers don't use or understand these files, so they appear as clutter to Windows users. Similarly, cloud storage services see them as regular files and count them toward your storage limit, even though they serve no purpose outside of macOS.

This is especially noticeable when you collaborate on projects. A Mac user opens a folder, makes changes, and the .DS_Store file updates. A Windows user on the same project sees an unfamiliar file appear in their sync folder. Over time, multiple .DS_Store files can accumulate if many Mac users work with the same shared location.

How to see .DS_Store files on your Mac

By default, macOS hides .DS_Store files from view in Finder. To see them, you need to show hidden files. Open Terminal (found in Applications > Utilities) and type this command:

defaults write com.apple.finder AppleShowAllFiles TRUE

Then press Enter and restart Finder by holding Option and right-clicking the Finder icon in the Dock, then selecting Relaunch. Hidden files, including all .DS_Store files, will now appear in Finder windows. To hide them again later, run the same command but replace TRUE with FALSE.

Deleting .DS_Store files safely

You can delete .DS_Store files without harming your Mac or any folder. The worst that happens is macOS creates new ones the next time you open those folders. If you want to remove them from a specific location, you can select them in Finder and press Delete, or use Terminal to remove them from a folder and all its subfolders with this command:

find /path/to/folder -name ".DS_Store" -type f -delete

Replace "/path/to/folder" with the actual path to the folder you want to clean. This is useful before sharing a folder with Windows users or before uploading files to a server where .DS_Store files would be unwanted clutter. However, there's no permanent benefit to deleting them — they'll return as soon as you browse those folders again.

Preventing .DS_Store creation on external drives and network locations

If you regularly work with external drives or network folders shared with Windows users, you can tell macOS to stop creating .DS_Store files on those locations. Open Terminal and run this command:

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true

This prevents .DS_Store creation on network drives and some external drives. For USB drives specifically, you can also format them as exFAT instead of Mac OS Extended format, which prevents .DS_Store creation because exFAT doesn't support hidden files the same way.

Note that this setting applies system-wide, so it affects all network and external locations you connect to. If you want to disable .DS_Store creation only for specific drives, Terminal offers more targeted commands, but the system-wide setting is the most practical for most users.

When .DS_Store files cause real problems

In most everyday situations, .DS_Store files cause no problems at all. They're invisible, they're tiny, and they don't interfere with your work. Problems arise mainly in three scenarios: when you're sharing folders with Windows users who see them as mysterious files, when you're uploading to a web server and want a clean file list, or when you're syncing to cloud storage and want to avoid unnecessary uploads and storage use.

Some developers and system administrators delete .DS_Store files as part of a cleanup routine before deploying files to servers or sharing code repositories. In those contexts, the files serve no purpose and can clutter version control systems like Git. For personal use on your own Mac, they're harmless and worth ignoring.

Frequently Asked Questions

Is it safe to delete .DS_Store files?

Yes, completely safe. Deleting them causes no damage to your Mac or any folder. The only consequence is that macOS will recreate them the next time you open those folders. You might lose custom view settings for that folder, but the folder itself and all its contents remain untouched.

Do .DS_Store files slow down my Mac?

No. These files are tiny — usually just a few kilobytes — and have no measurable impact on performance. Even with thousands of them across your drive, they won't make your Mac slower. They're not worth worrying about from a performance standpoint.

Why does my Mac create these files if Windows can't use them?

macOS creates .DS_Store files for its own use, not for compatibility with other systems. The operating system has no way to know in advance whether a folder will be shared with Windows users, so it creates these files in every folder by default. It's a design choice that prioritizes Mac user experience over cross-platform compatibility.

Can I prevent .DS_Store files from being uploaded to cloud storage?

Most cloud storage services, including Dropbox and Google Drive, allow you to exclude file types from syncing. Check your cloud storage settings and look for an option to ignore .DS_Store files. Alternatively, you can use the Terminal command mentioned above to prevent their creation on network drives in the first place.

What's the difference between .DS_Store and other hidden Mac files?

.DS_Store is just one of many hidden files macOS creates. Others include .Spotlight-V100 (for search indexing) and .TemporaryItems (for temporary data). All hidden files start with a dot and are hidden by default. Most serve system functions and should be left alone, but .DS_Store is the most commonly encountered and the safest to delete.