# What is a DS\_Store File \(How to Open, Hide, Delete & Disable\)

## Is it safe to delete DS\_Store files?

**Quick Answer:**

Yes, DS\_Store is created by macOS to store folder settings.

You can: Option 1:[Delete DS\_Store files in a specific folder](#delete-in-folder) Option 2:[Delete all DS\_Store files on a Mac](#delete-all) Option 3:[Set to delete all DS\_Store files on a Mac automatically and regularly](#delete-automatically)

More details from[iBoysoft](https://iboysoft.com/)

![DS\_Store files on Mac, Windows and GitHub](https://iboysoft.com/images/en-wiki/ds-store/summary-ds-store-files.jpeg)

## What is a DS\_Store file?

**DS\_Store**\(shortened for Desktop Services Store\) files, the macOS version of Windows's[desktop.ini](https://iboysoft.com/data-recovery/can-i-delete-desktop-ini.html)files, are automatically created by Finder on local internal & external disks or remote file systems mounted from servers to store a folder's custom view preferences. Such as an icon's position, the chosen view option, the choice of a background image, the folder's window location & size, and column sorting.

## Where will you see DS\_Store files?

The file extension \(.DS\_Store\) starts with a period, signaling a hidden file ordinarily invisible to users. However, you will see them suddenly showing up on the desktop or in an open folder when copied to a Windows PC, copied over a network, restored from a backup, or accidentally enabled Show All Files on Mac. In a word, a DS\_Store file will be generated on every folder Finder accesses.

On macOS 10.11 and earlier, you will see the DS\_Store files on the desktop or any folder after configuring[your Mac to show hidden files](https://iboysoft.com/mac-data-recovery/recover-and-show-hidden-files-mac.html). However, Since macOS 10.12, the DS\_Store files won't display even when thedefaults write com.apple.Finder AppleShowAllFiles TRUEcommand is applied.

Tried on[macOS Monterey](https://iboysoft.com/wiki/macos-monterey.html), other hidden folders like.tmp will appear after executing the command but not the DS\_Store files.

DS\_Store files in Google Drive

When transferring data from Mac's external SSD to Google Drive, you will notice many hidden files, including DS\_Store files being uploaded.

DS\_Store files on Windows PC

If you are a cross\-platform user or used to receiving files shared from a Mac, you will notice DS\_Store files when opening a Mac\-created folder or archive on Windows.

DS\_Store files in GitHub repository

GitHub repository tracks all changes made to a file, including the DS\_Store files. To avoid committing unnecessary stuff, you can use the.gitignore files located in the[root directory](https://iboysoft.com/wiki/mac-root-directory.html)to ignore DS\_Store files by following the steps given in[this post](https://stackoverflow.com/questions/1753070/how-do-i-configure-git-to-ignore-some-files-locally/1753078#1753078).

## How to open DS\_Store files on Mac/Windows?

Different apps may use the same file extension.DS\_Store for different types of data, so there's no specific DS\_Store opener for all kinds of files.

To open DS\_Store files in Windows, you can right\-click on the file, click Open With, then choose an application. Some user\-suggested applications are Windows Notepad, WinRAR, Free File Viewer, Adobe Acrobat, Microsoft Office, etc. Also, try dragging the file to a browser to open it.

To open DS\_Store files on Mac, you can right\-click on the file, click Open With, then choose a proper application. If no compatible software is found, look for a free online DS\_Store file opener.

## Can I delete DS\_Store files on Mac?

Yes, you can delete DS\_Store files on Mac without losing crucial data. But the folder appearance will revert to the default preferences. Besides, a new blank DS\_Store file will be created the next time you open the folder. If you don't want to see them, you're recommended to hide them rather than delete them.

## How to hide DS\_Store files on Mac?

**To hide DS\_Store files on Mac**:

1. Open Finder \> Applications \> Utilities \> Terminal.
2. Input the following command and press Enter. defaults write com.apple.finder AppleShowAllFiles FALSE
3. Use this command to exit Finder. killall Finder

If the DS\_Store file is still visible, you can force quit Finder, then check if the file is hidden.

## How to delete DS\_Store files on Mac?

### To delete DS\_Store files in a specific folder on Mac:

1. Open Finder \> Applications \> Utilities \> Terminal.
2. Execute the command below to locate the folder you want to delete the DS\_Store files. cd folderpath E.g., To delete all DS\_Store files on the desktop, enter cd desktop and press Enter. To delete all DS\_Store files on other folders, type cd followed by a space, drag the folder icon to Terminal, and press Enter.
3. Type the following command and hit Enter. find. –name '.DS\_Store' –type f –delete
4. Select OK.

### To delete all DS\_Store files on Mac:

1. Open Finder \> Applications \> Utilities \> Terminal.
2. Enter the following command and hit Enter. sudo find / \-name “.DS\_Store” \-depth \-exec rm \{\} \\;
3. Enter the administrator password.

### To delete all DS\_Store files on Mac automatically and regularly

1. Open Finder \> Applications \> Utilities \> Terminal.
2. Paste this command and press Enter. sudo crontab \-e
3. Enter the administrator password if required.
4. Open your vim editor and press the I key once.
5. Then type this command: Minute Hour DayofMonth Month DayofWeek root find / \-name “.DS\_Store” \-depth \-exec rm \{\} \\; E.g. To automatically delete DS\_Store files at 9:45 a.m every day, use: 45 9 \* \* \* root find / \-name ".DS\_Store" \-depth \-exec rm \{\} \\;
6. To save the crontab entry, press Esc once, then press Shift \+ Z \+ Z simultaneously.

The command will run when your Mac is on or in Sleep mode.

## How to disable the automatic creation of DS\_Store files on Mac?

Although you can't stop macOS from generating the DS\_Store files on local drives, you can disable the automatic creation of DS\_Store files on shared[network drives](https://iboysoft.com/wiki/network-drive.html)by following these steps:

1. Open Finder \> Applications \> Utilities \> Terminal.
2. Execute the following command: defaults write com.apple.desktopservices DSDontWriteNetworkStores true
3. Restart your Mac.
