mkdir 语法
mkdir [-p] dirName
参数说明:
-p:确保目录名称存在,不存在的就建一个。
示例1:
在/tmp/目录下创建一个test目录。
输入命令:
mkdir /tmp/test
![图片[1]-Linux操作系统怎么创建目录-编程社](https://cos.bianchengshe.com/wp-content/uploads/2022/05/weixintupian20220526013648.png?imageMogr2/format/webp/interlace/1/quality/100)
示例2:
在不存根目录下创建一个子目录。
在/tmp/bianchengshe/目录下创建一个bianchengshe1目录,/tmp/bianchengshe不存在。
输入命令:
mkdir /tmp/bianchengshe/bianchengshe1 ##创建失败,提示bianchengshe目录不存在
![图片[2]-Linux操作系统怎么创建目录-编程社](https://cos.bianchengshe.com/wp-content/uploads/2022/05/weixintupian20220526013916.png?imageMogr2/format/webp/interlace/1/quality/100)
使用下面命令,创建成功:
mkdir -p /tmp/bianchengshe/bianchengshe1 ##创建成功
![图片[3]-Linux操作系统怎么创建目录-编程社](https://cos.bianchengshe.com/wp-content/uploads/2022/05/weixintupian20220526014437.png?imageMogr2/format/webp/interlace/1/quality/100)
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容