A .DS_Store file is a hidden folder that macOS creates automatically to store display settings for each directory
When you open a folder on a Mac, the operating system remembers how you arranged the files, what size the icons were, where you scrolled to, and other visual preferences specific to that folder. macOS saves this information in a file called .DS_Store (Desktop Services Store) so the folder looks the same way the next time you open it. The file is invisible by default — you won't see it in Finder unless you turn on hidden file visibility.
These files are created automatically and exist on nearly every Mac. They take up minimal space individually, but they can accumulate across your entire drive. On external drives or network folders shared with Windows users, .DS_Store files can cause confusion because Windows does not create or recognize them, making them appear as clutter.
Understanding what .DS_Store files do helps you decide whether to remove them, ignore them, or prevent new ones from being created. The choice depends on how you use your Mac and whether you share files with other operating systems.
Key Takeaways
- .DS_Store files store folder view settings like icon size and window position, and macOS creates them automatically in every folder you open.
- These files are hidden by default and take up minimal space, but they can accumulate and appear as clutter on external drives or shared folders.
- You can safely delete .DS_Store files without harming your Mac, though macOS will recreate them the next time you open those folders.
- If you share files with Windows users or want to prevent new .DS_Store files, you can disable their creation using Terminal commands or third-party tools.
- Removing .DS_Store files from external drives before sharing them prevents Windows users from seeing unnecessary system files.
Where .DS_Store files appear and why they multiply
macOS creates a .DS_Store file in every folder you access, including your Desktop, Documents, Downloads, and any subfolder within those directories. If you have 50 folders on your Mac, you likely have 50 .DS_Store files. On external hard drives or USB flash drives, they accumulate the same way — one per folder you open.
The files are especially noticeable on external drives because they remain there even after you disconnect. If you plug a drive into a Windows computer, those .DS_Store files show up as mysterious system files that Windows does not understand. They do not harm anything, but they clutter the folder view for Windows users and can make a shared drive look disorganized.
Network folders and cloud storage can also fill with .DS_Store files. If you access a shared folder on a server or open files stored in Dropbox or iCloud Drive through Finder, macOS creates .DS_Store files there too. This is why developers and IT teams often set up rules to automatically delete these files from shared spaces.
How to see hidden .DS_Store files on your Mac
By default, .DS_Store files are invisible in Finder. To see them, you need to enable the display of hidden files. Open Terminal (found in Applications > Utilities) and type this command:
defaults write com.apple.finder AppleShowAllFiles true
Press Enter, then quit and reopen Finder. Now you will see all hidden files, including .DS_Store, as faded icons. To hide them again, use the same command but replace true with false.
Alternatively, you can use the keyboard shortcut Command + Shift + Period (.) in Finder to toggle hidden files on and off without opening Terminal. This method is faster if you only want to check occasionally.
Safely deleting .DS_Store files
You can delete .DS_Store files without damaging your Mac or losing any data. The worst that happens is macOS recreates them the next time you open those folders. If you want to remove them from your entire drive, open Terminal and type:
find ~ -name '.DS_Store' -type f -delete
This command searches your home directory and all subfolders, then deletes every .DS_Store file it finds. The process takes a few minutes depending on how many folders you have. You can also target a specific external drive by replacing the tilde (~) with the drive's path.
If you prefer not to use Terminal, you can delete .DS_Store files manually by enabling hidden file visibility, then selecting them in Finder and pressing Delete. This approach takes longer but gives you control over which files you remove.
Preventing new .DS_Store files from being created
If you want to stop macOS from creating .DS_Store files altogether, you can disable the feature using Terminal. Type this command:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
This prevents .DS_Store files from being created on network drives and external drives, but not on your internal Mac drive. To also prevent them on your Mac itself, use:
defaults write com.apple.desktopservices DSDontWriteLocalStores true
Keep in mind that disabling .DS_Store creation means Finder will not remember your folder view settings. Each time you open a folder, it will reset to the default view. Most people find this annoying enough that they leave the feature enabled and straightforward delete the files periodically instead.
Removing .DS_Store from external drives before sharing
If you regularly share external drives or USB flash drives with Windows users, cleaning out .DS_Store files before handing over the drive is a professional courtesy. It prevents Windows users from seeing system files they cannot use and makes the drive appear cleaner.
Connect the external drive to your Mac, open Terminal, and type:
find /Volumes/[DriveName] -name '.DS_Store' -type f -delete
Replace [DriveName] with the actual name of your external drive as it appears in Finder. This removes all .DS_Store files from that drive without affecting any of your actual files or folders.
After cleaning, you can safely eject the drive and give it to a Windows user. The drive will work normally, and no .DS_Store files will reappear unless a Mac user opens folders on it again.
Third-party tools for managing .DS_Store files
If you find Terminal commands intimidating, several Mac applications can delete or prevent .DS_Store files automatically. Apps like CleanMyMac X and AppCleaner include options to remove these files as part of their cleanup routines. Some developers use tools like .DS_Store Remover, which is a straightforward drag-and-drop process that deletes the files from any folder you drop onto it.
These tools are optional — Terminal commands do the same job for free — but they offer a graphical interface if you prefer not to type commands. Choose whichever method feels most comfortable for your skill level.
Frequently Asked Questions
Do .DS_Store files slow down my Mac?
No. Individual .DS_Store files are tiny (usually a few kilobytes each) and have no measurable impact on performance. Even with thousands of them across your drive, they will not make your Mac noticeably slower. Deleting them will not speed up your computer.
Will deleting .DS_Store files cause problems?
No. Deleting .DS_Store files is completely safe. Your Mac will straightforward recreate them the next time you open those folders. You will not lose any documents, photos, or settings — only the folder view preferences stored in those specific files.
Why do .DS_Store files appear on my external drive after I delete them?
Because macOS recreates them every time you open a folder on that drive. If you want to prevent new ones from appearing, use the Terminal command to disable .DS_Store creation on external drives, or avoid opening folders on the drive with Finder.
Can I ignore .DS_Store files and leave them alone?
Yes, if you do not share drives with Windows users or upload files to servers. They take up negligible space and cause no problems on a Mac-only system. Only delete them if they bother you or if you need to share the drive with other operating systems.
What is the difference between .DS_Store and other hidden files on my Mac?
.DS_Store is specific to folder display settings. Other hidden files like .bash_profile or .gitignore serve different purposes and should not be deleted unless you know what they do. Only delete .DS_Store files if you are certain that is what you are removing.