What is .DS_Store and How to remove it from your macOS (2024)

By Kevin ArrowsUpdated on July 22, 2021

Kevin is a certified Network Engineer

Most of the users are unaware of .DS_Store files until they find it themselves someday. These files are always hidden in your system folders and working to maintain the display settings of that specific folder for the user. However, you can find the existence of these files by viewing hidden files or using Terminal to list all files in folder/directory. Also if you’re sharing with a Windows PC, you will see these files in every folder and also on Desktop. In this article, we will tell you all about .DS_Store files and how to remove them from your system.

What is .DS_Store and How to remove it from your macOS (1)

What are .DS_Store Files in macOS?

The .DS_Store files (DS stands for Desktop Services) are automatically generated in your macOS. They contain information about how to display folders when the user opens them. These files are created by macOS Finder to save the information about icons position, size and position of the window when it was last time opened on the system. You can easily find these files through Terminal by command as shown below:

sudo ls
What is .DS_Store and How to remove it from your macOS (2)

Note: The simple “ls” command will only show the files and folders but with sudo you will be able to see all the hidden and invisible system files.

.DS_Store file acts similar to Thumb.db, which is created automatically in Windows OS for every folder. When users copy a folder from macOS to Windows, this file will become visible.

Consequences of removing .DS_Store from macOS

.DS_Store files don’t cause any harm and take very little space in your system’s storage. But sharing files with Windows OS or uploading on OneDrive will result in failure and cause the problem for most of the users. Other than that, there is no performance benefit in deleting these files and it is best to leave them as it is. When the user happens to delete this file then the appearance of the folder will revert to the default preferences.

Method 1: Deleting .DS_Store Files for Specific Folder through Terminal

  1. Hold Command and Press Space to open Spotlight, type Terminal to search and Enter
    What is .DS_Store and How to remove it from your macOS (3)
  2. Change the directory to the folder from which you want to delete .DS_Store files by using the command:
    cd desktop

    (Change desktop to the path which you want to access)

  3. Now type the following command to delete all the .DS_Store files in the current directory:
    find . –name '.DS_Store' –type f –delete

    Note: You can type –print at the end of the command to print deleted files list as shown below.

    What is .DS_Store and How to remove it from your macOS (4)
  4. Files will be deleted in the following folder and it will be safe to transfer without any errors.

Method 2: Removing .DS_Store Files for all Folders on System through Terminal

  1. Hold Command and Press Space to open Spotlight, type Terminal to search and Enter
    What is .DS_Store and How to remove it from your macOS (5)
  2. Use this command to remove all the .DS_Store files from the system:
    sudo find / -name ".DS_Store" –depth –exec rm {} \;
    What is .DS_Store and How to remove it from your macOS (6)
  3. All the .DS_Store files on the system will be removed but it will be generated for most of the folders which user or system will access.

Method 3: Cleaning .DS_Store Files by using iMyMac Cleaner

iMyMac is a cleaning tool for macOS which scans all your system for junk and inactive files. By cleaning these files, the user can save storage space and keep the system performance better. This is similar to the CCleaner on Windows, helping you removing junk files and clearing the browser cache data for users. iMyMac toolkit provides more features, like duplicate finder, mac uninstaller, file shredder, and extensions manager. We will use this utility to clean the .DS_Store files.

You can download and install it from their official website: iMyMac
After iMyMac Cleaner is installed, then follow the steps below:

  1. Hold Command and Press Space to open Spotlight, type iMyMac to search and Enter to open the application
    What is .DS_Store and How to remove it from your macOS (7)
  2. Click the Scan button on the main screen of iMyMac
    What is .DS_Store and How to remove it from your macOS (8)
  3. After the scan is done, click Review option next to the Junk Files
    What is .DS_Store and How to remove it from your macOS (9)
  4. You can locate the .DS_Store file and click on Cleanbutton. But sometimes there are .DS_Store files inside the cache folders or others as shown below in Terminal:
    What is .DS_Store and How to remove it from your macOS (10)
  5. All the selected .DS_Store files or folders containing these files will be cleaned by iMyMac.
    What is .DS_Store and How to remove it from your macOS (11)

By Kevin ArrowsUpdated on July 22, 2021

Kevin is a certified Network Engineer

What is .DS_Store and How to remove it from your macOS (2024)

References

Top Articles
Latest Posts
Article information

Author: Kerri Lueilwitz

Last Updated:

Views: 5792

Rating: 4.7 / 5 (67 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Kerri Lueilwitz

Birthday: 1992-10-31

Address: Suite 878 3699 Chantelle Roads, Colebury, NC 68599

Phone: +6111989609516

Job: Chief Farming Manager

Hobby: Mycology, Stone skipping, Dowsing, Whittling, Taxidermy, Sand art, Roller skating

Introduction: My name is Kerri Lueilwitz, I am a courageous, gentle, quaint, thankful, outstanding, brave, vast person who loves writing and wants to share my knowledge and understanding with you.