Linux delete empty directories

class:Linux views:108 Author:xiaomo314
Command
rmdir -pv /root/newdir2/newdir3
Explanation
-p : delete the directory recursively, when the parent directory is empty after the subdirectory is deleted, it will also be deleted
-v : output processing directory details
Operation result
[root@localhost ~]# rmdir -pv /root/newdir2/newdir3
rmdir: removing directory, ‘/root/newdir2/newdir3’
rmdir: removing directory, ‘/root/newdir2’
rmdir: removing directory, ‘/root’
rmdir: failed to remove directory ‘/root’: Device or resource busy

This platform is gradually under construction, more development orders are gradually included, any questions or Suggestions can be Contact Us