mkdir命令主要用于建立文件夹,是一个默认安装的用户命令:
参数:
-m:设置文件夹权限,类似chmod
-p:递归创建目录 SourceByrd's Weblog-https://note.t4x.org/rebuilding/mkdir-command-description/
案例:
0 1 2 3 4 5 6 7 8 9 10 |
[root@Test5 tmp]# mkdir -m 777 abc #设置文件夹权限为777 [root@Test5 tmp]# ls -l drwxrwxrwx 2 root root 4096 Oct 29 07:40 abc [root@Test5 tmp]# mkdir iii/aaa/ccc mkdir: cannot create directory `iii/aaa/ccc': No such file or directory [root@Test5 tmp]# mkdir iii/aaa/ccc -p [root@Test5 tmp]# tree -d . ├── iii │ └── aaa │ └── ccc |
其他参数:SourceByrd's Weblog-https://note.t4x.org/rebuilding/mkdir-command-description/
SourceByrd's Weblog-https://note.t4x.org/rebuilding/mkdir-command-description/SourceByrd's Weblog-https://note.t4x.org/rebuilding/mkdir-command-description/-v:打印出建立文件夹的说明
-Z:--context=CTX
set the SELinux security context of each created directory to CTX
When COREUTILS_CHILD_DEFAULT_ACLS environment variable is set, -p/--parents option respects default umask and ACLs,
as it does in Red Hat Enterprise Linux 7 by default SourceByrd's Weblog-https://note.t4x.org/rebuilding/mkdir-command-description/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!