Linux 中 mkdir -p选项

 

001、测试1

[root@pc1 test1]# ls
[root@pc1 test1]# mkdir a/b/c              ## mkdir创建连续目录,失败
mkdir: cannot create directory ‘a/b/c’: No such file or directory
[root@pc1 test1]# ls
[root@pc1 test1]# mkdir -p a/b/c           ## 增加 -p选项, 表示传递创建
[root@pc1 test1]# ls
a
[root@pc1 test1]# tree                     ## 查看结构
.
└── a
    └── b
        └── c

3 directories, 0 files

。 

 

posted @ 2024-01-31 17:48  小鲨鱼2018  阅读(7)  评论(0编辑  收藏  举报