Skip to Content

DS_Store Files: What They Are & How To Remove Them

This article will discuss DS_Store files, why they're important, how to create them, and how to manage them on your computer.

Ad - Web Hosting from SiteGround - Crafted for easy site management. Click to learn more.
Advertising Disclosure: I am compensated for purchases made through affiliate links. Click here for details.

What Is A DS_Store File?

DS_Store (Desktop Services Store) files are the macOS equivalent of the Windows desktop.ini file and are automatically created by the Finder application to store a folder's custom view preferences. These preferences include icon positioning, custom view options, column sorting, and the folder's window location and size on the screen.

How Is A DS_Store File Created?

DS_Store files are saved with a file name of .DS_Store to the local file server or hard drive and get automatically created within every folder the Finder application accesses.

Why Should I Know About DS_Store Files?

It's important to learn about these types of files and their function before you do anything with them. As DS_Store files store custom preferences and metadata about their containing folders and other files, it's important to keep this information private. Exposing details within these files could allow hackers to view private files and perform malicious acts on your system.

Is It Okay To Delete DS_Store Files?

You can safely delete DS_Store files without losing any crucial data. Doing so will only revert your folder's appearance and preferences back to their default settings. The next time you change your folder preferences, a new DS_Store file will be auto-generated.

How to Hide DS_Store Files

To hide all DS_Store files on a Mac, complete the following steps:

  • 1. In the Finder navigation menu, click Go > Utilities > Terminal
  • 2. Input the following command:
defaults write com.apple.finder AppleShowAllFiles FALSE
  • 3. Exit all instances of Finder:
killall Finder
If the DS_Store files are still visible after completing these steps, force quit Finder and check for the files again.

How to Delete DS_Store Files In A Specific Folder

To delete a single DS_Store file within a specific folder on your Mac:

  • 1. In the Finder navigation menu, click Go > Utilities > Terminal
  • 2. Locate the location of the DS_Store file by navigating to your folder:
cd /path/to/folder
  • 3. Enter the following command:
find . -name ".DS_Store" -type f -delete
Important Note: Never use wildcards (*) with this command unless you know what you're doing. You could inadvertently delete crucial files that you won't be able to recover.

How to Delete All DS_Store Files on Your Mac

To delete all DS_Store files stored on your Mac:

  • 1. In the Finder navigation menu, click Go > Utilities > Terminal
  • 2. Enter the following command:
sudo find / -name ".DS_Store" -depth -exec rm {} \;
  • 3. Enter the administrator password to complete the process.
Again, make sure you have a complete understanding of how these commands work before executing them. You could inadvertently delete crucial files that you won't be able to recover.

Conclusion

This article covered DS_Store files, their function, typical use cases, how to create them, and how to manage them on your computer.

Posted by: Josh Rowe
Last Updated: February 17, 2023
Created: February 15, 2023

Comments

There are no comments yet. Start the conversation!

Add A Comment

Comment Etiquette: Wrap code in a <code> and </code>. Please keep comments on-topic, do not post spam, keep the conversation constructive, and be nice to each other.