I decided to follow numanoid’s advice on how to delete all the .wdmc droppings on my system, since I don’t need them, and they’re taking up about 100MB of space:
find . -type d -name ‘.wdmc’ -print0 | xargs -0t rm -rf
Login in via SSH.
Before I did anything else, I went to the top level of the user file system:
At least if anything went wrong with the deletion, it should only delete my user data, and I have that all backed up…
I also stopped and disabled the wdmcserverd and wdphotodbmergerd sevices.
Just to check what this command was going to do (I had a pretty good idea already), I ran the find command on its own.
find . -type d -name ‘.wdmc’ -print > wcjunk.txt
Note the change from ‘print0’ to ‘print’. print0 uses a null character /0 to separate output lines, which is a bit unwieldy in a text file. print uses a normal line feed.
Result: yes, it’s found lots of .wdmc leaf directories, and only .wdmc leaf directories.
Now to look at the deletion part, as that ‘rm -rf’ is a bit scary…
I checked the xargs bit with Wiki
It’s being used to allow the output of find to be sent to the rm command, and seems to be a nice safe way of avoiding the pitfalls of spaces and commas in piped text streams.
rm -rf deletes the directory and any files and subdirectories. As I said, a bit scary, so I wanted to make sure if was going to be sent a correct list of directories.
All looked good, so I entered the command, checked and re-checked I’d typed it correctly, added a background task ‘&’ to the end, and hit return
find . -type d -name ‘.wdmc’ -print0 | xargs -0t rm -rf &
This allowed me to keep doing ‘ls’ as it ran, to make sure it wasn’t trashing the entire disk structure.
Some time later, I got the command complete message:
+ Done find . -type d -name ‘.wdmc’ -print0 | xargs -0t rm -rf
Just to check, I re-ran the earlier command to list all the .wdmc directories. Result: none found.
So, thanks to numanoids for the deletion advice. It worked a treat.