Hacker News new | past | comments | ask | show | jobs | submit login

find / -name ".DS_Store" -exec rm {} \; 2>/dev/null

Put that in a script and add it to your crontab.






That's gonna be incredibly slow on most developer machines. node_modules, __pycache__, Cargo target/ folders, Yocto build folders, .git folders, etc etc etc -- all my machines which are ever used for development end up with such a gargantuan amount of small files across the filesystem that any operation which involves iterating through all of them takes forever.

Besides, there are .DS_Store I really don't wanna delete. Notably, there are git repos which have erroneously committed .DS_Store files; I don't wanna make those repos dirty by deleting them.


Cool. This was a response to ops github repo which does the same as the command I commented with. Your use case is different.

That doesn't seem to be true? Looking at the C source code, it seems to be using fsevents to delete .DS_Store files when they're created, not periodically scan every single file on the system to delete .DS_Store files

Ah ok. Thanks for pointing that out.

-delete is faster

Even better!



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: