Linux rmdir(英文全拼:remove directory)命令删除空的目录。
语法格式 : rmdir [参数] [目录名称]
常用参数:
-p | 用递归的方式删除指定的目录路径中的所有父级目录,非空则报错 |
-v | 显示命令的详细执行过程 |
— — help | 显示命令的帮助信息 |
— — version | 显示命令的版本信息 |
参考实例
删除空目录:
[root@bianchengshe ~]# rmdir dir
递归删除指定的目录树:
[root@bianchengshe ~]# rmdir -p dir/dir1/dir2
显示指令详细执行过程:
[root@bianchengshe ~]# rmdir -v dir
rmdir: removing directory, 'dir'
[root@bianchengshe ~]# rmdir -p -v dir/dir1/dir2
rmdir: removing directory, ‘dir/dir1/dir2’
rmdir: removing directory, ‘dir/dir1’
rmdir: removing directory, ‘dir’
显示命令的版本信息:
[root@bianchengshe ~]# rmdir --version
rmdir (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容