I would like to delete all empty folders on an external disk. How can I do this?
First of all note that deleting empty directories usually isn't necessary. Some services or applications might even need certain directories to exist. Be aware of what you're doing.
You can list empty folders with
Now, if you want to delete whatever
Note: This will not ask for confirmation. It'll delete all the directories it can, i.e. the ones where you have permissions to delete. They will not be moved to the trash but gone forever. If you want to be asked before removal, change the command to something like the following: