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.

28 lines
856 B

5 years ago
# **mkdir**
7 years ago
6 years ago
## 说明
7 years ago
5 years ago
**mkdir命令** 用来创建目录
7 years ago
5 years ago
## 选项
5 years ago
5 years ago
```markdown
7 years ago
5 years ago
用法mkdir [选项]... 目录...
Create the DIRECTORY(ies), if they do not already exist.
7 years ago
5 years ago
Mandatory arguments to long options are mandatory for short options too.
-m, --mode=MODE 建立目录的同时设置权限
-p, --parents 若所建立目录的上层目录尚未建立,则一并创建上层目录
-v, --verbose print a message for each created directory
-Z 设置安全上下文当使用SELinux时生效
--context[=CTX] like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX
# 多个目录要用空格隔开
7 years ago
```
5 years ago
## 实例
7 years ago
5 years ago
```bash
5 years ago
mkdir -p -m 700 /usr/meng/test # 在目录`/usr/meng`下建立子目录test并且只有文件主有读、写和执行权限其他人无权访问
7 years ago
```