+5 votes
366 views
What are .DS_Store files and what are they for?

in Guides by (445k points)
reopened by | 366 views

2 Answers

+4 votes
Best answer

How to remove all .DS_Store files?
How to prevent .DS_Store files from reappearing

Have .DS_Store files ever appeared in your folders and you don't know where they came from? Do you know what they are and what they are for ? Would you like to remove them permanently? In this article we explain what those .DS_Store files are, what their function is and how you can get rid of them .

The first thing to explain is their function and why they appear. The .DS_Store files are created by the Mac OS X operating system in any directory (including network folders) that is opened with Mac Finder, and its function is to “memorize” the position of the icons and the background of the folders. Under OS X these files are hidden and as a general rule they are not seen, but from Windows or Linux we will see them in all the directories that we have previously viewed with Finder.

DS_Store on OS X

So, the function of .DS_Store is more or less like the Windows desktop.ini, or like the thumbs.db only that the latter only appears in directories that contain images, since it is a database of thumbnails.

How to remove all .DS_Store files?

The .DS_Store files can be removed quickly and it is also safe to do so, although you should bear in mind that doing so will lose OS X's ability to memorize the position of the icons and their backgrounds.

To perform a mass removal in OS X, you must open a "Terminal" (from spotlight you write Terminal and run it, or else from the Launchpad -> Applications -> Utilities). Once the terminal is open, you must position yourself in the root directory by executing the command (without quotes) "cd \" and after doing so, execute the following command:

sudo find / -name «.DS_Store» -depth -exec rm {} \;

You will be asked for the computer administrator password, and after providing it, all the .DS_Store files will be removed from the system.

How to prevent .DS_Store files from reappearing

It is also possible to tell Mac OS X not to generate any .DS_Store files again, and also this task is reversible so you can test how you are doing and if you don't like or regret leaving it as it was.

To do this, open a Terminal again and type the following command:

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

If we want to leave the system as it was, we will simply have to repeat this process but changing the word "true" at the end of the command to "false" and we will have our system again with the .DS_Store that OS X creates by default.


by (445k points)
+3 votes

What are the .DS_Store files and what is their function?
How can I open the .DS_Store files?
Security implications of this type of file.

It is increasingly common to find files with extension .DS_Store, which for those who do not know MacOS, are unknown files. The .DS_Store (Desktop Services Store) files are files that contain system customization information, such as icons, background type, font, columns, etc.

image

This type of files is created automatically by the MacOS file manager called Finder . The equivalent to the .DS_Store files in Windows could be the Thumbs.db or desktop.ini files.

What are the .DS_Store files and what is their function?

Surely on more than one occasion you have used a USB pendrive of a partner who has a Mac and you have been scared to see files with extension .DS_Store scattered throughout the folders . These files are preceded by a period, so in the Mac OS file system they remain hidden, but in Windows they are visible . They are not dangerous files nor is it a virus.

The main functionality of these files is to store metadata of the different files and folders. Its use only makes sense at the operating system level, so using them on network drives or USB sticks makes no sense.

The possibility of disabling the creation of these files on network drives has been around for some time, but on local disks there is no definitive solution. Although they are harmless files, when sharing them can pose a risk to our security, since they expose data from our local file structure .

How can I open the .DS_Store files?

These files do not have a specific program to be edited. Its content is encoded to be used directly by the MacOS operating system, so they are not readable with a text editor or similar.

Security implications of this type of file.

image There are security tools that allow you to process the .DS_Store files and extract your data to present them in a readable way. For this reason, it is considered that this type of files may have an impact on our security if we share them publicly .

There are terminal commands to delete all the .DS_Store files from your operating system, but you have to execute them with caution, since you will lose all the customization options. Even so, it is a recommended option, especially in those folders that you share publicly.


by (2.8m points)

Related questions

+5 votes
1 answer
asked Aug 9, 2019 in Guides by backtothefuture (445k points) | 122 views
+5 votes
1 answer
+3 votes
1 answer
+5 votes
1 answer
8,517 questions
8,621 answers
407 comments
2 users