rmdir doc
If the doc is empty directories are deleted, otherwise it can not be deleted.
rmdir -p test2/test3
Recursively delete empty directories, first determine test3, if test3 is empty, delete test3, test2 judgment at this time, if test2 is also empty, then delete test2.