To delete all .DS_Store files from subfolders (on macOS), you can use Terminal. Below are the steps to do it safely:
-
Open Terminal
-
Navigate to the directory where you want to delete all .DS_Store files.
For example, if the folder is in Documents, type:cd ~/Documents/your-folder-name
-
Run the following command to find and delete all
.DS_Store
and_.DS_Store
files recursively:sudo find . -type f \( -name ".DS_Store" -o -name "._.DS_Store" \) -delete -print 2>&1
-
You can also verify the deletion file by running:
sudo find . -type f \( -name ".DS_Store" -o -name "._.DS_Store" \) -print 2>&1
If nothing is returned, all .DS_Store files are successfully removed.