WD My Cloud NAS added hidden .wdmc folders to every folder with a jpg without notifying or asking me first. There are many hundreds on my NAS drive. It has something to do with their media server but I never turned that feature on. These folders are packed with data that bloats my backups and disk space usage. They have to be deleted but they are all over the disk and sometimes deep inside directory structures.
On Superuser.com I found this advice, ran it in Terminal, and it appeared to spend all night deleting these folders. However, it didn't delete the target folders or the data in them.
$ find . -type d -name '.wdmc' -print -exec echo rm -rf {} \;
I also found this but it only worked for folders with no spaces in the name:
rm -rf `find . -type d -name .wdmc`
Somehow in the path there must be a way to escape the spaces in folder names?