首页 > 代码库 > Linux常用命令之rmdir

Linux常用命令之rmdir

        1.命令功能

            rmdir    :删除空白目录

        2.命令格式

            rmdir [选项] 目录

        3.命令参数

            -p    :递归删除

            -v    :显示详细信息

        4.命令实例

            例子1:不能删除非空目录

[root@bogon ~]# ls

aa  abc  anaconda-ks.cfg  Desktop  file1  file2  gg  install.log  install.log.syslog

[root@bogon ~]# rmdir aa

rmdir: aa: Directory not empty

            例子2:递归删除空目录

[root@bogon ~]# mkdir -pv aa/bb/cc/dd

mkdir: created directory `aa‘

mkdir: created directory `aa/bb‘

mkdir: created directory `aa/bb/cc‘

mkdir: created directory `aa/bb/cc/dd‘

[root@bogon ~]# rmdir -p aa/bb/cc/dd

[root@bogon ~]# ls

aa  abc  anaconda-ks.cfg  Desktop  file1  file2  gg  install.log  install.log.syslog

[root@bogon ~]# ls

abc  anaconda-ks.cfg  Desktop  file1  file2  gg  install.log  install.log.syslog

            例子3:显示详细信息

[root@bogon ~]# mkdir -pv aa/bb/cc/dd

mkdir: created directory `aa‘

mkdir: created directory `aa/bb‘

mkdir: created directory `aa/bb/cc‘

mkdir: created directory `aa/bb/cc/dd‘

[root@bogon ~]# rmdir -pv aa/bb/cc/dd/

rmdir: removing directory, aa/bb/cc/dd/

rmdir: removing directory, aa/bb/cc

rmdir: removing directory, aa/bb

rmdir: removing directory, aa

                   

                 

            


            

            

本文出自 “冷血杀手” 博客,请务必保留此出处http://deathkiller.blog.51cto.com/9130248/1592324

Linux常用命令之rmdir