It is necessary to list non-empty directories in a subdirectory Trying to use
find . ! -type d -empty -print
but it doesn't work,
You're asking for "things that are not directories and are empty", which includes all zero-length files (and would exclude all directories). You want "things that are directories and are not empty", so:
find . -type d ! -empty -print