mkdir命令

2021-02-03  本文已影响0人  敬bug一杯

mkdir命令

1.命令功能

mkdir <span style="color:red">make directories</span>如果目录不存在,则创建目录。

Create the DIRECTORY(ies), if they do not already exist.

2.命令格式

[root@localhost ~]# mkdir [选项]... 目录...

3.参考事例

[root@localhost ~]# mkdir tmp
[root@localhost ~]# mkdir -m 700 /home/tmp/yejx
[root@localhost ~]# mkdir yejx yejx2
[root@localhost ~]# mkdir -p yejx/dir

4.参数详解

选项 释义 功能描述
-m mode set file mode (as in chmod), not a=rwx - umask建立目录的同时设置目录的权限
-p parents no error if existing, make parent directories as needed如果存在,请根据需要创建父目录
-v verbose print a message for each created directory显示目录的创建过程
-Z set SELinux security context of each created directory to the default type将每个创建的目录的SELinux安全上下文设置为默认类型
上一篇 下一篇

猜你喜欢

热点阅读