.DS_Store File on Mac - What is it and How to Delete?

You may have noticed the .DS_Store files on your Mac and wondered what they are and what you should do with them and whether it's safe to delete them. This article will look at this commonly encountered Mac file and explain what it's used for.

The .DS_Store file you may see in folders on your Mac is generated automatically. It is created by Finder in browser directories on your storage drives. The .DS_Store files contain information about your system's configuration and contain data that tells your Mac how to display the files in those folders.

In rare cases, you may find that Finder is acting strange and is not displaying a folder the way it used to. In this case, you may want to delete the .DS_Store file located in the same folder. In some cases, the .DS_Store file may become corrupted and you will no longer be able to perform certain tasks in the folder that contains the corrupted file, such as changing the folder's view options or sorting the files the way you want.

In those cases, you may safely delete .DS_Store files to refresh the folder and its preferences. To do this, follow these steps:

  1. Start the Terminal app by going to Applications -> Utilities -> Terminal
  2. Type "cd" in the terminal window, followed by the directory path you want to delete the .DS_Store file in then hit Enter.
  3. Once you've navigate to the directory, type "find . -name '.DS_Store' -type f -delete" and hit Enter again.

This will take care of the faulty .DS_Store and delete it.

You should also keep in mind that when you create a compressed file on your Mac, the .DS_Store file from the folder you created the archive in will get included in the archive. You may want to manually delete that file from inside the archive, because it may carry information identifying your system. This is something you might want to consider if you will be uploading the compressed file to a public location.

February 21, 2022