Try this command:
find . -empty -type d -delete
find command is used to search for files/directories matching a particular search criteria from the specified path, in this case the current directory (hence the
-empty option holds true for any file and directory that is empty.
-type d option holds true for the file type specified; in this case
d stands for the file typedirectory.
-delete option is the action to perform, and holds true for all files found in the search.
Leave a Reply