I have some folders that have been created in error. I would like remove these folders.
¬ 636
¬ 636.empty
¬ 637
¬ 638.empty
¬ 639
¬ 639.empty
In this situation I would like to remove 636.empty
and leave the remaining none empty folder.
After I have ran the terminal command I would like all folders that a sister
folder to be removed.
¬ 636
¬ 637
¬ 638.empty
¬ 639
Removed folders would be:
¬ 636.empty
¬ 639.empty
I have some 25,000
folders maybe 1000
of these are duplicates with the empty
folder
Loop through all directories named
*empty
and check if same directory without.empty
exists and delete if true:Replace
rmdir
withrm -rf
if the directory is not empty despite its name ;-)A
find
alternative:Replace
-delete
with-exec rm -rf {} \;
if the directory is not empty.