网站接入空间,百度联盟项目看广告挣钱,中山好的网站建设,江门加盟网站建设1.命令作用
如果目录还不存在#xff0c;则创建目录(Create the DIRECTORY, if they do not already exist.)
2.命令语法
Usage: mkdir [OPTION]... DIRECTORY...
3.参数详解
OPTION:
-m, --modeMODE#xff0c;创建新目录同时设置权限模式-p, --parents#xff0c;创…1.命令作用
如果目录还不存在则创建目录(Create the DIRECTORY, if they do not already exist.)
2.命令语法
Usage: mkdir [OPTION]... DIRECTORY...
3.参数详解
OPTION:
-m, --modeMODE创建新目录同时设置权限模式-p, --parents创建多层目录如上层目录不存在会自动创建-v, --verbose创建目录时打印目录创建信息-Z没有具体英文单词是一个选项标志用于创建一个带selinux上下文的目录
4.常用用例
1.-m参数创建一个指定mode的目录
[rootlocalhost test]# mkdir -m 777 Dir1
[rootlocalhost test]# ll
total 0
drwxrwxrwx. 2 root root 6 Jan 6 13:55 Dir1
[rootlocalhost test]#
2.-p参数创建多层目录
[rootnode2 test]# ll
total 0
[rootnode2 test]# mkdir Dir1/Dir2/Dir3
mkdir: cannot create directory ‘Dir1/Dir2/Dir3’: No such file or directory
[rootnode2 test]# mkdir -p Dir1/Dir2/Dir3
[rootnode2 test]# tree
.
└── Dir1└── Dir2└── Dir33 directories, 0 files
[rootnode2 test]#
3.-v参数创建目录输出创建信息
[rootnode2 test]# mkdir -v Tdir1
mkdir: created directory ‘Tdir1’
[rootnode2 test]#
4.一次多次创建多个同级目录
[rootnode2 test]# ll
total 0
[rootnode2 test]# mkdir Dir1 Dir2 Dir3
[rootnode2 test]# ll
total 0
drwxr-xr-x. 2 root root 6 Jan 6 14:04 Dir1
drwxr-xr-x. 2 root root 6 Jan 6 14:04 Dir2
drwxr-xr-x. 2 root root 6 Jan 6 14:04 Dir3
[rootnode2 test]#