I want to remove all directories (and subdirectories) that are empty - in the current directory.
One command I know that will accomplish this is:
$ find . -type d -empty -exec rmdir -v {} \; 2>/dev/null
Is there any other single command - NOT script, or chaining of commands
via pipes - that that can accomplish this?
If there isn't any other single command to accomplish this, I'll entertain other
methods. However, I'm primarily interested in 'siingle' commands!!!!
@Trevor Your command also contains a loop or a piping like thing as "-exec" .
Best one liner is :
find /path/ -type d -empty -delete
https://man7.org/linux/man-pages/man1/find.1.html
@Trevor Your command also contains a loop or a piping like thing as "-exec" .
Best one liner is :
find /path/ -type d -empty -delete
https://man7.org/linux/man-pages/man1/find.1.html
Nothing like 2 sets of eyes - especially when one of those sets is
guaranteed to detect flaws, and elevate the solution!!!
Thanks Chetan for another contribution to the elevation of my
knowledgebase!!!
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.