Locating and removing empty directories is easy with the find command. Below are the two simple commands to find and delete empty folders from your system.
To find empty directories, you can use the following command:
find . -type d -empty
To delete empty directories, you can add a
find . -type d -empty -delete