commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
A quick way to find and delete empty dirs, it starts in the current working directory.
If you do find . -empty -type d you will see what could be removed, or to a test run.
There is 1 alternative - vote for the best!
this will show the names of the deleted directories, and will delete directories that only no files, only empty directories.
This will check if there are any empty directories, or newly emptied directories, in a list of directories. It will then delete all of those directories. It works with gnu find and OSX/BSD find.
If you can do better, submit your command here.
You must be signed in to comment.