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 --delete
flag:
find . -type d -empty -delete
Comments are closed, but trackbacks and pingbacks are open.