7.7 "Linux learning is not difficult" file/directory Management (7): rmdir command to delete empty directories
Use the rmdir command to remove an empty directory from a Linux system.
Command syntax:
rmdir [Options] [contents]
The meanings of the options in the command are as shown in the table.
Options |
option meaning |
-P |
Delete directories recursively, and when subdirectories are deleted, their parent directory is empty. |
Example: Delete Empty directory newdir1.
[Email protected] ~]# rmdir newdir1
Example: Delete both the empty directories/root/newdir2 and/ROOT/NEWDIR2/NEWDIR3.
[Email protected] ~]# rmdir-p/root/newdir2/newdir3
This article extracts from "Linux Learning is not difficult" textbook, which is one of the most practical, theoretical and practicalLinuxIntroductory materials. To read the entire book, please visitLinuxoperation and Maintenance person(www.linuxywz.com) website.
"Linux learning is not difficult" file/directory Management (7): rmdir command to delete empty directories