1. Introduction to Commands
rmdir (remove directory deletes directories): Used to delete empty directories, you must also have write access to the parent directory when deleting a directory.
2. Usage
Usage:rmdir [options] ... Directory...
3. Options
--ignore-fail-on-non-empty ignores all errors generated only by non-empty directories-p,–parents Delete the specified directory and its parent folder, such as "Rmdir-p a/b/c" and "RmDir a/b/c A/b a ' "Basic same-v,–verbose output processing directory details
4. Instance 1: Delete an empty directory
rmdir Dir1
Example 2: Delete empty directory display information
rmdir -v dir3rmdir"dir3"
Example 3: Delete a non-empty directory
rmdir -v dir2rmdir"dir2"rmdir"Dir2 " failed: Directory not empty
Example 4: If the parent directory is empty, the parent directory is recursively deleted
rmdir -PV dir1/sub1/sub2rmdir"dir1/sub1/sub2"rmdir "dir1/sub1"rmdir"dir1 "
One Linux command per day (5): RmDir