Linux用来创建指定名称的目录,注意创建目录的用户需要有当前所在目录的可写权限,否则创建没有权限创建目录,并且指定的目录不能是当前目录已经存在目录。
mkdir [选项] 目录
通过
mkdir
在指定目录创建目录
mkdir -m 755 test
> mkdir test > ls test
> mkdir -p rumenz/one
755
权限的目录> mkdir 755 www
> mkdir -v rumenz
> mkdir -vp src/{lib/,bin/,sbin/{doc,info},doc/{js,css,html},rumenz/lib/{test,info}} mkdir: created directory ‘src’ mkdir: created directory ‘src/lib/’ mkdir: created directory ‘src/bin/’ mkdir: created directory ‘src/sbin’ mkdir: created directory ‘src/sbin/doc’ mkdir: created directory ‘src/sbin/info’ mkdir: created directory ‘src/doc’ mkdir: created directory ‘src/doc/js’ mkdir: created directory ‘src/doc/css’ mkdir: created directory ‘src/doc/html’ mkdir: created directory ‘src/rumenz’ mkdir: created directory ‘src/rumenz/lib’ mkdir: created directory ‘src/rumenz/lib/test’ mkdir: created directory ‘src/rumenz/lib/info’ > tree src src ├── bin ├── doc │ ├── css │ ├── html │ └── js ├── lib ├── rumenz │ └── lib │ ├── info │ └── test └── sbin ├── doc └── info