Although the user-level representation of Mac OS is actually simple, the processes underneath in fact still have the same complex levels of Unix operability. However, .DS_Store files are in fact placed inside every folder of a Macintosh system and their purpose isn’t something complicated either. But as the users don’t get to see the .DS_Store files very often, once they see the folder somewhere inside their Macs they would get curious. To meet the inquiries of all the curious cats out there, here we discuss about the .DS_Store file.
What is a .DS_Store File?
Well, a .DS_Store file contains a whole lot of information about a folder. It’s basically a metadata storage file for every folder on Mac. These files are hidden inside every folder, and a Mac user won’t see them unless the hidden files are made visible. Whichever folder the Finder application on Mac can access will certainly have the .DS_Store file around. Finder is the equivalent of Windows Explorer by the way, just in case you were wondering.
What information are stored in a metadata? Well, in the case of .DS_Store file, information like icon information, custom icon information, color schemes of the icons in a folder, background picture (if any) inside a folder, window placement information for a specific folder, information required to show a folder in list order inside Finder etc. are stored in the .DS_Store file. Since the intention of the .DS_Store file in a Macintosh platform is to stay out of sight and not to intrude with any other ongoing processes, the filename begins with a period (.).
In Unix operating system, a file that starts with a period will most likely be overlooked by most applications except for the ones that looks for such files. It’s an easier way to keep files invisible to programs. Linux have similar applications as well. For example, if you are techie enough you might have heard about .nomedia files in Android.
How to Hide DS_Store File on Mac OS X
To hide DS_Store file on your Mac, you need to disable the hidden files to be shown in your folders. To do that, you need to enter the following command in terminal:
defaults write com.apple.Finder AppleShowAllFiles FALSE
Now relaunch Finder (right click - Relaunch) and the DS_Store and all other hidden files will be disappeared from your folders.
How to Remove DS_Store File on Mac
To remove the DS_Store file from your Mac, just you need to move it to the trash, or you can delete it directly with right click - move to trash.
What happens if .DS_Store file is deleted?
The files aren’t protected, they are just hidden. A Mac user can delete a .DS_Store file without any additional level of permissions like being a root user. Will the deletion of .DS_Store impose a crucial problem? Apparently, no. Unless you have customized a folder with flying colors or maybe even a background image, there isn’t supposed to be an issue with the deletion of .DS_Store file. However, we will strongly recommend keeping the .DS_Store files intact and undeleted.
DS_Store File shows up in Networks Connections
In a network environment where frequent file transfer takes placed between platforms, the Windows users may very often see .DS_Store files in almost every folders that comes from the Macintosh users. It might be annoying to the eyes but that’s how the Mac OS works. Macs connected to a Mac base network will not have such issues, but in a cross-platform connected environment .DS_Store files are kind of annoying.
How to Disable .DS_Store Creation on Network Connections
defaults write com.apple.desktopservicesDSDontWriteNetworkStores true
Conclusion: The appearance of .DS_Store files is slightly complicated, mostly due to the structure of its name but as you can see, it’s really nothing but a metadata file.