N天学习一个Linux命令之mkdir

前言

暂无

用途

用于新建目录

常用参数

1.设置目录权限
-m, --mode=MODE

2.递归创建目录(父目录不存在时,也创建)
-p, --parents

3.其它
-v, --verbose
print a message for each created directory

-Z, --context=CTX
set the SELinux security context of each created directory to
CTX

--help display this help and exit

--version
output version information and exit

实践

1.新建目录testdir,权限设置为所有用户可读可写可执行
[root@hlj_wx_pre03 ~]# mkdir -m 0777 testdir

2.递归创建目录a/b 父目录a不存在
[root@hlj_wx_pre03 ~]# mkdir -p a/


后记

暂无

参考资料
【1】man mkdir

作者:WadeYu
出处:http://www.cnblogs.com/wadeyu/
本文版权归本人和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
原文地址:https://www.cnblogs.com/wadeyu/p/6395014.html