[OpenIndiana-discuss] Deleting empty directories

Michelle michelle at msknight.com
Wed Aug 2 20:54:23 UTC 2023


At the moment I'm doing something on an OI server which is executed by
a Linux client. However, due to the "Resource temporarily unavailable
(11)" through the linux mounting (even with the cache off, etc.) I'm
having to try and replicate this on the OI server itself.

Basically, I extract all the flac files out of my main music
collection, to a separate location, (using rsync) and then I have to
delete the empty directories that rsync has created.

I managed the first part, no problem. However, it's the deleting of
empty directories that is causing me trouble.

The Linux command is...
find /mnt/jaguar/users/michelle/FlacCopy -type d -empty -delete
...however the OI version of find doesn't support -empty

I've tried to install gfind, but that doesn't appear to be available.

I've tried to follow various scripts... (the below is just to print
empty directories at the moment, for testing)
find /mnt/jaguar/users/michelle/FlacCopy -type d | xargs -i ls -ed {} |
awk '{if ($5=="2"){ print $0 }}'
...but I fall foul that some of the names in the directories contain '
(eg. Sinead O'Connor) which then causes the command to fail with,
"xargs: Missing quote"

Any clues would be gratefully received.

Michelle.



More information about the openindiana-discuss mailing list