开发中我们会遇到嵌套创建文件目录的需要,这时需要用到
比如我要在本地嵌套创建
/Users/dairui/Downloads/zookeeper/dataLogDir目录
直接使用
mkdir /Users/dairui/Downloads/zookeeper/dataLogDir
会报错,缺少zookeeper文件。
这时加上 -p参数 就可以嵌套创建了。创建好后,记得修改目录的权限。