1. Find empty directories in the current directory using find -empty:
$ find . -type d -empty
2. Use the following command to remove all empty directories under the current directory:
$ find . -type d -empty -exec rmdir {} \;
3. Find empty files in the current directory using find -empty:
$ find . -type f -empty
4. How many empty files are located under the current directory (and sub-directories)? To count the number of empty files under the current directory, pipe the find command to wc -l.
$ find . -type f -empty | wc -l
5. How many non-empty files are located under the current directory (and sub-directories)?
$ find . -type f -not -empty | wc -l
In all the above examples, replace the ( . ) dot with any other directory path under which you would like to search the files.