DEV Community

Katz Ueno
Katz Ueno

Posted on

3 2

How to delete .DS_Store, or some system files recursively

When you zip files in Mac OS or Windows, it sometime include system files that you don't see when you were working.

When you unzip the files, you see them.

You go nuts!

Well, you probably set .gitignore to ignore those system files. It will probably be harmless.

However, you just don't want to leave those junk.

You will use find command to delete them

Originally posted on my blog
https://en.katzueno.com/2021/10/11/how-to-delete-ds_store-php-files-recursively/

Delete .DS_Store or ._* files

cd [Path/To/UnarivedFolder]
find . -name ".DS_Store" -delete; find . -name "._*" -delete
Enter fullscreen mode Exit fullscreen mode

find command is very useful to delete some junk files systematically.

Delete .bak files

cd [Path/To/UnarivedFolder]
find . -name "*.bak" -delete
Enter fullscreen mode Exit fullscreen mode

TIPS: Configure your Mac not to save .DS_Store files

# Start terminal
# Set default not to store .DS_Store file
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
# Force restart Finder
killall Finder
Enter fullscreen mode Exit fullscreen mode

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more