You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
892 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# **rmdir**
## 说明
**rmdir命令** 删除指定的`空目录`。rmdir命令可以从一个目录中删除一个或多个空的子目录。删除目录时必须具有对其父目录的写权限
注意子目录被删除之前应该是空目录。就是说该目录中的所有文件必须用rm命令全部另外当前工作目录必须在被删除目录之上不能是被删除目录
本身,也不能是被删除目录的子目录
## 选项
```markdown
--ignore-fail-on-non-empty 忽略仅由目录非空产生的所有错误
-p, --parents 删除目录,若该目录删除后上层目录变为空目录一并删除; 例如:'rmdir -p a/b/c' 和 'rmdir a/b/c a/b a'相同
-v, --verbose output a diagnostic for every directory processed
```
## 实例
```bash
rmdir -p bin/os_1 # 删除子目录os_1,若bin目录为空则删除否则保留
```