What is .DS_Store?
While it appears to be a useless addition to a folder, a .DS_Store file (the “DS” stands for “Desktop Services”) is important in helping Mac work out how to display folders when you open them.
The file is created by the Finder whenever a .zip file is created and contains information about how a folder will be opened, such as icon positions, window size and shape, and the window’s position when last opened on the desktop. You might also find .DS_Store files in archives that you’ve received from other Mac users.
The files as they sit in a folder on your Mac don’t cause any harm. Which is good because the only way to stop them from being created is to quit using the Finder and that’s something none of us want to consider.
Why would you need to delete DS_Store files?
So why would you want to get rid of a file that doesn’t cause any harm and takes up very little space in a folder? A few of reasons:
1. You want to reset your display preferences.
2. The Finder is behaving oddly when opening a folder. As with any computer file, it’s possible for .DS_Store files to become corrupted. Things such the inability to see or sort icons, change view options, or a folder that closes within a second of being opened are a sure sign of a .DS_Store gone bad.
3. You’re transferring files between your Mac and another system. When moving files from your computer over to a Windows or Linux system, a .DS_Store file can cause unexpected problems. They’re alien to PCs and can raise suspicions from users unfamiliar with macOS.
How to delete a .DS_Store file
Before we show you how it’s done, let us first of all reassure you that deleting a .DS_Store file is perfectly safe. No harm will come to a folder.
You should also know that as soon as preferences are changed, the Finder will create a new .DS_Store file that you’ll probably want to delete at some point. Basically, it’s a never-ending battle — you versus .DS_Store.
Deleting .DS_Store files: The easy way
Using a tool like CleanMyMac 3 lets you delete .DS_Store files easily and in bulk without having to go down the manual route of entering Terminal commands. It’s also a sure-fire way of making sure every trace of .DS_Store is removed from your folders.
.DS_Store falls under the category of System Junk on CleanMyMac 3, which is essentially what it is when you no longer need a file. Removing files couldn’t be simpler:
- Download CleanMyMac 3 (for free!)
- Launch the app.
- Click on System Junk from the sidebar menu.
- Hit Scan and wait for CleanMyMac to do its thing.
- Hit Clean for no more .DS_Store dictating how your folders should look.
And you’re all done. There won’t be a .DS_Store file to be found… Until your Mac creates a new one.
Deleting .DS_Store files manually
If you want to go down the manual route and delete .DS_Store files individually, you can do this using the Terminal:
1. Go to Applications > Utilities > Terminal.
2. Locate the folder or directory that you want to remove the .DS_Store file from.
3. Type “cd” into the Terminal followed by your folder path so it looks something like this: cd /Users/username/nameoffolder
4. Hit Enter.
5. Type find . -name '.DS_Store' -type f -delete
6. Hit Enter again.
The .DS_Store files in the selected folder will now disappear.
Keep your Mac junk free
.DS_Store files are useful for retaining viewing preferences so that folders display in the way the creator intended. But the second these preferences aren’t required or a file acts up, it’s best to remove them from your Mac using either of the ways we’ve shown you here and start afresh.
CleanMyMac 3 is designed to rid your system of junk files with minimum fuss to ensure your Mac runs exactly how you like it. Download it now to keep folders and files working seamlessly.