亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Linux命令學(xué)習(xí)總結(jié)之rmdir命令

 更新時(shí)間:2016年01月20日 11:12:48   作者:瀟湘隱者  
這篇文章主要介紹了Linux命令學(xué)習(xí)總結(jié)之rmdir命令的相關(guān)資料,需要的朋友可以參考下

命令簡介:

rmdir命令用用來刪除空目錄,如果目錄非空,則會(huì)出現(xiàn)錯(cuò)誤??梢允褂胷m刪除目錄中的文件后,使用rmdir刪除目錄。也可以使用rm -rf替代rmdir命令。這是一個(gè)非常簡單的命令。

命令語法:

rmdir [OPTION]... DIRECTORY...

命令參數(shù):

參數(shù)

長參數(shù)

描敘

--ignore-fail-on-non-empty

忽略任何應(yīng)目錄里面有數(shù)據(jù)文件而造成的錯(cuò)誤

-p

--parents

遞歸刪除目錄

-v

--verbose

顯示命令執(zhí)行的詳細(xì)信息

--help

顯示命令在線幫助

--version

顯示命令版本信息

使用示例:

1: 查看rmdir命令的幫助信息

[root@DB-Server ~]# rmdir --helpUsage: rmdir [OPTION]... DIRECTORY...Remove the DIRECTORY(ies), if they are empty. --ignore-fail-on-non-empty ignore each failure that is solely because a directory is non-empty -p, --parents Remove DIRECTORY and its ancestors. E.g., `rmdir -p a/b/c' is similar to `rmdir a/b/c a/b a'. -v, --verbose output a diagnostic for every directory processed --help display this help and exit --version output version information and exit Report bugs to <bug-coreutils@gnu.org>.

也可以使用下面命令查看rmdir文檔信息

[root@DB-Server ~]# man rmdir

2: 使用rmdir刪除空目錄

如果目錄非空,則會(huì)出現(xiàn)錯(cuò)誤信息。

[root@DB-Server ~]# ls /root/kerry/file1[root@DB-Server ~]# rmdir kerryrmdir: kerry: Directory not empty[root@DB-Server ~]# rm -f /root/kerry/*[root@DB-Server ~]# rmdir kerry

3:顯示命令執(zhí)行時(shí)的詳細(xì)信息

[root@DB-Server ~]# mkdir test1 test2 test3[root@DB-Server ~]# lsanaconda-ks.cfg Desktop install.log install.log.syslog test1 test2 test3[root@DB-Server ~]# rmdir -v test1 test2 test3rmdir: removing directory, test1rmdir: removing directory, test2rmdir: removing directory, test3

4:遞歸刪除目錄,如下所示,首先創(chuàng)建目錄kerry,在kerry目錄下創(chuàng)建空目錄tmp,接下來空目錄test

[root@DB-Server ~]# mkdir -p kerry/tmp/test[root@DB-Server ~]# tree kerrykerry`-- tmp `-- test 2 directories, 0 files[root@DB-Server ~]# rmdir -p kerry/tmp/test

5:忽略任何應(yīng)目錄里面有數(shù)據(jù)文件而造成的錯(cuò)誤

[root@DB-Server ~]# mkdir kerry [root@DB-Server ~]# cd kerry [root@DB-Server kerry]# touch file1 [root@DB-Server kerry]# cd .. [root@DB-Server ~]# rmdir --ignore-fail-on-non-empty kerry/

相關(guān)文章

最新評(píng)論