The .DS_Store file is a hidden folder your Mac creates automatically to remember how you like to view folders
Every time you open a folder on a Mac, the operating system records details about that folder — the size of the window, which files you had selected, where icons are positioned, and what view you preferred (list, icon, or column view). macOS stores this information in a file called .DS_Store, which stands for "Desktop Services Store." The file sits invisibly inside each folder you've opened.
The dot at the beginning tells macOS to hide the file from normal view. You won't see it when you browse your folders in Finder, which is by design — Apple assumes most people don't need to think about it. But the file is there, taking up a small amount of disk space and updating itself every time you adjust how a folder looks.
Key Takeaways
- .DS_Store files are created by macOS in every folder you open to remember your view preferences and window settings.
- These files are completely safe and are not malware, viruses, or security threats of any kind.
- Deleting .DS_Store files will not harm your Mac — macOS will straightforward recreate them the next time you open those folders.
- On Windows computers, you may see .DS_Store files appear if you've transferred folders from a Mac or used external drives between systems.
Why .DS_Store files exist and what they contain
The .DS_Store file is part of how macOS makes the user experience feel smooth and personal. When you resize a Finder window, sort files by name or date, or arrange icons in a specific pattern, you expect that arrangement to be there the next time you open that folder. Without .DS_Store, you'd have to reset your preferences every single time.
The file also stores metadata about the folder itself — things like custom folder icons, background images, or comments you've added. It's essentially a settings file, similar to how your web browser remembers your zoom level on websites or your preferred font size in an app.
Why you might see warnings about .DS_Store
Occasionally, people encounter warnings online suggesting that .DS_Store files are a security risk or that they should be removed. These warnings are misleading. The file is not malware, does not transmit data, and does not contain personal information beyond your folder viewing preferences.
The confusion sometimes arises because .DS_Store files can reveal information about your folder structure if you share an external drive or cloud folder with someone else. For example, if you delete a file but the .DS_Store still references it, someone could theoretically see that a file once existed there. This is a privacy consideration in specific sharing scenarios, not a security threat to your computer itself.
When .DS_Store files appear on Windows computers
If you use both a Mac and a Windows computer, or if you share external drives between the two systems, you may see .DS_Store files show up on your Windows machine. Windows doesn't use these files and doesn't know what to do with them, so they just sit there taking up minimal space.
This happens because when you connect a Mac-formatted drive to Windows, or when you transfer folders from a Mac to a Windows system, the .DS_Store files come along. They're harmless on Windows — the operating system straightforward ignores them — but you can delete them if they bother you. Windows will not recreate them because Windows doesn't use this file type.
How to delete .DS_Store files if you want to
If you want to remove .DS_Store files from your Mac, you first need to make them visible. Open Terminal (found in Applications > Utilities) and type: defaults write com.apple.finder AppleShowAllFiles true, then press Enter. Close and reopen Finder, and hidden files will now appear.
You can then manually delete individual .DS_Store files by selecting them and pressing Command+Delete. However, macOS will recreate them as soon as you open those folders again. If you want to prevent .DS_Store files from being created in the first place, you can use the Terminal command: defaults write com.apple.desktopservices DSDontWriteNetworkStores true. This stops macOS from creating .DS_Store files on network drives and external drives, which is useful if you frequently share drives with Windows users.
Whether deleting .DS_Store affects your Mac's performance
Deleting .DS_Store files will not speed up your Mac or free up meaningful disk space. Each file is typically only a few kilobytes — even if you have hundreds of them, they add up to less than a megabyte of storage. macOS will recreate them when ready, so any space you free up is temporary.
If you're looking to improve your Mac's performance or free up storage, .DS_Store files are not the place to focus. More effective steps include deleting large files you no longer need, clearing your browser cache, removing duplicate photos, or uninstalling unused applications.
Frequently Asked Questions
Is .DS_Store a virus or malware?
No. .DS_Store is a legitimate system file created by macOS. It contains only folder view preferences and does not execute code, transmit data, or pose any security risk to your computer.
Will my Mac run slower if I delete all .DS_Store files?
No. These files are too small to affect performance. macOS will straightforward recreate them as you use your folders. If your Mac feels slow, the cause is elsewhere — consider checking your storage space, closing unused applications, or restarting your computer.
Why do .DS_Store files appear on my external drive?
macOS creates .DS_Store files on any drive you connect and open folders on, including external drives and USB sticks. If you share these drives with Windows users, you can prevent new .DS_Store files from being created by using the Terminal command mentioned above.
Can I hide .DS_Store files again after making them visible?
Yes. Open Terminal and type: defaults write com.apple.finder AppleShowAllFiles false, then press Enter. Close and reopen Finder, and hidden files will disappear from view again.