Computer

.DS_Store files, why do they appear on my hard drive?

The first thing we should know about this file is that it is only useful in macOS and Unix, the operating system on which Apple’s operating system for computers is based. Outside of macOS and Unix, that is, on both Windows and Linux, the DS_Store folder is completely useless.

What is .DS_Store and what is it used for

.DS_Store refers to Desktop yesservices Store and are related to the system. these files are generated automatically every time the Finder (the macOS file explorer), comes into contact with a drive and they are always hidden both on macOS and on Windows and Linux. If we connect a pen drive or hard drive to a Mac and, without performing any operation, we safely disconnect it from the computer (previously ejecting the unit), when reconnecting the unit to a PC with Windows or Linux, we will verify how an error has been generated. file with this name.

When you open a drive or directory from the macOS Finder, the system automatically generates the .DS_Store file, a file that stores the position of files and folders together the size of the Finder window and icon, the window display format (list, grid, preview), the number of columns with file information.

The operation of this file is very similar to that of thumbs.db, a file that Windows generated in previous versions to create a directory where a thumbnail of all the images stored in a folder was stored, in this way, when accessing a directory, could show instead of an image icon, a thumbnail of it.

If we deleted this file, we did not lose any data stored on the drive. The only inconvenience we found was that, when accessing a folder or unit with images, this file would have to be generated again, so the initial loading time was longer.

Can I delete them?

Not having no utility on windows, every time we come across .DS_Store files, we can safely remove it from our computer. This type of file only has a function in macOS and Unix, as I mentioned above, since it allows the Finder to know how the data stored on that unit was displayed the last time it was accessed, since this file is modified every time it is accessed from the macOS file explorer, even if we do not make any notable changes.

If we use a Mac, we can also delete these files without any problem, since they do not contain system information, they only store a record of the Finder settings. If we delete them, the Finder will generate a new file again unless we deactivate that option through Terminal, an option that we show you below.

Delete .DS_Store files in Windows

The process to delete .DS_Store files on both Windows and Linux is exactly the same as the one we followed for delete any other files that is not part of the system. We just have to select it with the mouse, in case of using the graphical interface and drag it to the trash, use the Delete option with the right mouse button or press the Delete button.

Delete all .DS_Store files on Mac

If we want to delete all the .DS_Store files found on a Mac, we must open the Terminal application located in the launch padinside the folder Others. We can also access it from Spotlight by typing the term Terminal and clicking on the first result.

terminal

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

Before carrying out the process of deleting all the .DS_Store files, the system will request the user password to confirm that we are the legitimate administrators of the team. If we want to carry out this task, from a standard user account, it will also be necessary to enter the device administrator password.

delete .DS_Store files

This command, whose process lasts a long time, it will delete all .DS_Store files that are in non-system folders. As it comes across system folders where it is not possible to delete these files, it will show the path with the result Operation not permitted. It will also inform us of the folders where it has not found this file with the text No such file or directory.

delete .DS_Store files

Prevent them from re-generating

As I mentioned above, deleting these files on Mac is absolutely useless, since they are automatically generated again. macOS allows us to disable the creation of this Finder log file through the following command that we must type in Terminal.

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

If we have changed our minds and find that .DS_Store files are useful, we can restore this function with the code

defaults write com.apple.desktopservices DSDontWriteNetworkStores false

Is it worth keeping this file?

Here everything depends on the needs and use we make of our equipment. If we usually work with a large number of files and folders from the Finder, it is recommended to keep this function activated, since it will avoid us having to resize the window each time to adapt to the number of files we want to display, the type of display, the amount of information that is shown of the files from the columns among other functions… since not all the folders store the same number of files / folders.

Open a full-screen Finder window to display only two files it does not make any sense, since we will be forced to reduce the size. When you shrink, the new size of the Finder window will be stored in the .DS_Store file. The next time we access that folder, it will be displayed with the same size that we had previously set. The same happens without changing the size of the icons, the display options…

If the use we make of the Finder is reduced to the minimum expression, keeping this function activated is absurd. However, if we take into account that the size of the .DS_Store files is a few bytes, removing this function will not allow us to free up space on our computer.

how can i open them

There is no application for Windows or Linux, which allows access to the inside of the .DS_Store files. Having no useful functionality on both operating systems, there is no reason for there to be an app that allows access to its content.

Being a file generated by the system, there is also no application from Apple or third parties that allows us to access its interior to modify its content.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *