Advertisement

Responsive Advertisement

What are ._ and .DS_Store files in macOS? How to delete effectively

macOS creates many hidden files when you work with this operating system, the most common of which are ._ and .DS_Store files. Although they are necessary in macOS for system and metadata management, when moving data to other systems (Windows, Linux, USB drives, network drives), they can be annoying or mess up folders. This article will help you understand these files and show you how to safely delete them.

1. What is a ._ file?

A ._ (dot underscore) file is a metadata file created by macOS to store extended information about the original file, including:
File permissions

Tags in Finder
Custom icons or special attributes
When you copy a file from macOS to a file system that doesn't support metadata (such as FAT32 or exFAT), macOS separates this metadata into a separate ._ file.
Example:

Original file: example.txt
Metadata file: ._example.txt
The ._ file does not affect the main content of the file, but it can be confusing or take up unnecessary space.

2. What is a .DS_Store file?

A .DS_Store (Desktop Services Store) file is created by macOS in each directory to store the display settings for that folder, such as:
File arrangement
Finder window size and position
Custom icons
This file is harmless within macOS but is often considered "junk" on other systems.

3. Why should you delete these files?

When transferring data to a different operating system or using external drives, ._ and .DS_Store files may:
Cause clutter in the directory view
Take up unnecessary space
Cause issues with certain applications or systems

4. How to delete ._ and .DS_Store files
4.1 Manual deletion

You can manually find and delete each ._ and .DS_Store file using Finder:
Open the folder containing the file.
Press Cmd + Shift + . to show hidden files.
Select the ._ or .DS_Store file and press Cmd + Delete to delete it.

4.2 Deleting with Terminal

The Terminal is a powerful tool to delete multiple files at once.
Delete ._ files: Use the following command to delete all ._ files in a directory:
bash

find /path/to/directory -name '._*' -delete

Delete .DS_Store files: Use the following command to delete all .DS_Store files in the directory and subdirectories:
bash

find /path/to/directory -name '.DS_Store' -delete

4.3 Using third-party applications

Some applications can automatically detect and remove unnecessary files:
BlueHarvest: Manages and prevents the creation of ._ and .DS_Store files on USB drives or network drives.
CleanMyMac: Deletes unnecessary files throughout the system.

5. Prevent creation of ._ and .DS_Store files

5.1 Prevent .DS_Store files on network drives

You can stop macOS from creating .DS_Store files on network drives with the following command:
bash

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

Then restart Finder with:
bash

killall Finder

5.2 Minimize creation of ._ files

Use disk formats that support macOS metadata, such as APFS or HFS+, when working with external drives to avoid separating metadata into ._ files.



6. Things to keep in mind when deleting files

Make sure you don’t accidentally delete the original file.
._ files may contain important data for older applications. If you're unsure, back up your data before deleting.
Conclusion
._ and .DS_Store files are an unavoidable part of using macOS, but they can be troublesome when working with other operating systems. Understanding their purpose and how to manage them will help you optimize your system and reduce hassle during your work.

If you frequently work with other operating systems or external drives, use the deletion and prevention methods above to keep your directories cleaner!

Post a Comment

0 Comments