How to Remove DS_Store File on Mac [2023 Complete Guide]

While exploring the features your Mac device offers, you may have stumbled upon the unhide feature. Basically, it’s a feature that allows you to unhide files and folders that are normally hidden. These are either system or virus-ridden files.

Among these files, you may have seen one named “DS_Store”. Though there are a ton of files that are similarly hidden, the .DS_Store file is particularly interesting since it shows up in pretty much any folder you’re in as if following you. But as interesting as it may be, it can get annoying, which begs the question, how does one remove DS_Store file on Mac?

To answer that question, you must first understand the reason why this file exists and how it works.

Part 1: An Overview of The DS_Store File

DS_Store stands for Desktop Services Store, and it’s basically a file that’s hidden from users by default. The Mac operating system (macOS) automatically creates this file whenever you open the Finder app. Once it’s created, the file will follow you wherever you go. For example, if you open Finder and head to your Applications folder, the DS_Store file will move to that folder as well. Of course, you won’t be able to see the file unless you have hidden files unhidden via the Settings.

The DS_Store file, much like any other file, contains information about the system. In particular, the DS_Store file contains information on the folders you’ve visited since it was created. If you delete this file, it simply erases your traces.

Therefore, it’s safe to assume that you can remove DS_Store file on Mac without causing an irreversible issue. However, when you delete the file, the system promptly creates a new copy once you open the Finder app again. It will then follow you around in every folder you open. Therefore, it can be annoying, but that’s not the only reason why you might want to delete this particular file from your Mac. The DS_Store file can actually bring detrimental effects to you and your computer.

The DS_Store File

Part 2: Why Should You Remove DS_Store File on Mac?

As stated earlier, the DS_Store file contains information on the folders you’ve been to since it was created by the macOS.

You can think of this file as basically a history log that tells you where you’ve been. Unfortunately, this can be disadvantageous in many scenarios. More specifically, it brings an inherent risk of exposing information on your folders.

Suppose you opened the Finder app on your Mac. You then proceeded to go to a folder named Projects, which contains all the project proposals you’re currently working on. Let’s assume that those projects are confidential, and you intend to delete them as soon as you’re done with the proposal. However, since the DS_Store file was also in this Projects folder, it’ll record information about that folder, including the documents that correspond to your project proposals.

Since that’s the case, even after you delete the documents, the DS_Store file will still have the necessary information to recover those documents. While that may sound like good news, it’s actually not, since hackers can exploit this file.

By gaining access to the DS_Store file on Mac, the hackers are basically gaining access to all the folders and files it has recorded, meaning your confidential files, as discussed in the example, will be in jeopardy. This is yet another reason why experts advise users to remove DS_Store file on Mac, to prevent the leaking of confidential data. With that said, how do you remove the DS_Store file on Mac?

Remove DS_Store File on Mac

Part 3: How to Remove DS_Store File on Mac Manually

There are generally two ways to remove the DS_Store file on Mac. You can either do it manually or use a Mac cleaning tool. The manual method is rather difficult since you have to remember the last folder you visited, as that should be where the DS_Store file is currently located. If you don’t necessarily have the best memory, this can be a struggle. Nevertheless, once you find the file, the process of deleting it is actually quite easy. You simply have to do what you usually do when you want to delete a file—select the file in question, then press the Delete key on your keyboard.

Yes, it’s a bit too straightforward, but one must remember that while it is a bit unique, the DS_Store file is still technically a file. And just like all files, you can delete it through normal means, that is, using the Delete key.

However, in many cases, you might not be able to gain access to the file in the first place, since, as stated earlier, it’s hidden by default. To “unhide” the file, or rather, give yourself the permission to view it, here’s what you need to do:

  1. Open Terminal from the Dock.
  2. Type in sudo ls in the Terminal to give you super-user root access.
  3. Type cd and minimize the Terminal.
  4. Look for the folder that contains the DS_Store file that you wish to delete.
  5. Drag the icon of that folder into Terminal. This will complete the file path for you.
  6. Press Enter on your keyboard.
  7. Finally, type in rm -f .DS_Store and press Enter again.

This should remove DS_Store file on Mac. It’s a bit harder than simply pressing the Delete button, but it’s still doable.

How to Remove DS_Store File on Mac

Part 4: Remove DS_Store File on Mac Using Mac Cleaner

The DS_Store file is, in a way, like an annoying bug that you can’t seem to get rid of. Though you can delete it with just a few clicks, the macOS will create another one as soon as you open the Finder app. What’s worse is you have to find the DS_Store file every time, which typically takes a considerable amount of time. If you wish to remove DS_Store file on Mac without much hassle, it’s best if you use a tool to automatically delete the file, and that’s where Mac Cleaner comes into play.

Mac Cleaner is a specialized Mac cleaner software that allows users to delete all kinds of unnecessary data on their Mac. This includes the DS_Store file. If you wish to use this software, below are the steps you need to follow:

Step 1. Start Mac Cleaner On Your Mac Computer

Open your browser and navigate to the Umate website to download the Mac Cleaner installer. Then, use the downloaded file to install the software on your computer. Afterward, start the program to proceed to the next step.

Step 2. Select The Clean Up Junk Module

Mac Cleaner has a total of six modules, each one with different functionalities. There’s a module for cleaning up junk and a module for erasing private data, among many things. Since the DS_Store file is considered junk, you must select the Clean Up Junk module for the purpose of this guide. Basically, what this module does is scan for files that are categorized as “junk” and provide you the option to delete them. The DS_Store file, in particular, belongs to the category System Junk.

Select The Clean Up Junk Module

Step 3. Click Scan

Once the Clean Up Junk module is selected from the left sidebar, the screen at the right will show various information about that particular module. It will also display a button that says Scan. Simply click this button to proceed to the next step.

Click Scan

Step 4. Select The DS_Store File From The List

After finishing the scan, Mac Cleaner will display a list of folders containing junk files. If a junk file isn’t contained within a folder, it’ll display that item in the list on its own. You have two options here. You can either find the DS_Store file manually by going through each folder, or you can tick the Select All checkbox to select all junk files, including the DS_Store file. We suggest doing the latter since that’ll make things easier.

Step 5. Click Clean

After selecting the files you wish to remove, simply click the Clean button at the top-right corner of the screen. This will delete all the selected files, saving you space and possibly deleting the annoying and potentially harmful DS_Store file.

Though this is a rather extravagant way to remove DS_Store file on Mac, it saves you the hassle of looking for the file manually. Furthermore, you can delete many other files that are likewise unnecessary, so it’s a win-win.

Click Clean

Part 5: FAQs On DS_Store File on Mac

Why does my Windows PC have the DS_Store file?

The DS_Store file is exclusive to macOS laptops and computers. Therefore, it may come as a surprise to find the file on your Windows, but there’s an explanation for this. The DS_Store file can actually be transferred to other devices, like Windows PCs, just like how you would transfer photos from one device to another. Similarly, a copy of the DS_Store file from your Mac may get transferred to Windows PCs if you connect your Mac computer to the PC via a cable or through remote access.

Can you completely prevent the creation of these files?

Yes, you can, though it would require some coding. Here’s how you do it:

  1. Open Terminal from the Dock.
  2. On the Terminal, type in the following code: defaults write com.apple.desktopservices DSDontWriteNetworkStores true
  3. Press Enter.

Note: If you wish to revert the setting, simply change true to false.

Closing Thoughts

Although the DS_Store file is an essential element of the Finder app, its disadvantages often outweigh its benefits. Not only can it be annoying at times, but hackers can also use the file to take a peek at your other files. This is particularly risky for business owners and people with rather intricate jobs who have a lot of important data. Alas, it can be challenging to locate this particular file every time you need to want to delete it. With Mac Cleaner, however, that shouldn’t be an issue.