简介
mkdir是创建目录的命令,rmdir是删除目录的命令,注意rmdir只能删除空目录
mkdir常用参数:
-p #如果父目录不存在,则同时创建父目录
-m #创建目录时指定目录权限
rmdir常用参数:
-p #若目录删除后,父目录若为空目录,则同时删除目录
mkdir实例
[root@localhost mtactor]
[root@localhost mtactor]
[root@localhost mtactor]
[root@localhost mtactor]
[root@localhost mtactor]
.:
test test2
./test:
test
./test/test:
test
./test/test/test:
./test2:
[root@localhost mtactor]
rmdir实例
[root@localhost mtactor]
test test2
[root@localhost mtactor]
[root@localhost mtactor]
rmdir: 删除 "test" 失败: 目录非空
[root@localhost mtactor]
[root@localhost mtactor]
[root@localhost mtactor]