婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁(yè) > 知識(shí)庫(kù) > linux中rmdir命令使用詳解(刪除空目錄)

linux中rmdir命令使用詳解(刪除空目錄)

熱門標(biāo)簽:制作地圖標(biāo)注 新科火車站地圖標(biāo)注點(diǎn) 外呼系統(tǒng)鏈接 桂林市ai電銷機(jī)器人公司 商店地圖標(biāo)注外賣入駐 磁力導(dǎo)航地圖標(biāo)注 地圖標(biāo)注的牌子 地址高德地圖標(biāo)注 外呼系統(tǒng)怎么弄

今天學(xué)習(xí)一下linux中命令: rmdir命令。rmdir是常用的命令,該命令的功能是刪除空目錄,一個(gè)目錄被刪除之前必須是空的。(注意,rm - r dir命令可代替rmdir,但是有很大危險(xiǎn)性。)刪除某目錄時(shí)也必須具有對(duì)父目錄的寫權(quán)限。

1.命令格式:

rmdir [選項(xiàng)]... 目錄...

2.命令功能:

該命令從一個(gè)目錄中刪除一個(gè)或多個(gè)子目錄項(xiàng),刪除某目錄時(shí)也必須具有對(duì)父目錄的寫權(quán)限。

3.命令參數(shù):

- p 遞歸刪除目錄dirname,當(dāng)子目錄刪除后其父目錄為空時(shí),也一同被刪除。如果整個(gè)路徑被刪除或者由于某種原因保留部分路徑,則系統(tǒng)在標(biāo)準(zhǔn)輸出上顯示相應(yīng)的信息。
-v, --verbose  顯示指令執(zhí)行過程
 
4.命令實(shí)例:

實(shí)例一:rmdir 不能刪除非空目錄
命令:
     rmdir doc
輸出:
[root@localhost scf]# tree
.
|-- bin
|-- doc
|   |-- info
|   `-- product
|-- lib
|-- logs
|   |-- info
|   `-- product
`-- service
    `-- deploy
        |-- info
        `-- product
 
12 directories, 0 files
[root@localhost scf]# rmdir doc
rmdir: doc: 目錄非空
[root@localhost scf]# rmdir doc/info
[root@localhost scf]# rmdir doc/product
[root@localhost scf]# tree
.
|-- bin
|-- doc
|-- lib
|-- logs
|   |-- info
|   `-- product
`-- service
    `-- deploy
        |-- info
        `-- product
 
10 directories, 0 files
 
說(shuō)明:
rmdir 目錄名 命令不能直接刪除非空目錄
 
實(shí)例2:rmdir -p 當(dāng)子目錄被刪除后使它也成為空目錄的話,則順便一并刪除
命令:
rmdir -p logs
輸出:
[root@localhost scf]# tree
.
|-- bin
|-- doc
|-- lib
|-- logs
|   `-- product
`-- service
    `-- deploy
        |-- info
        `-- product
 
10 directories, 0 files
[root@localhost scf]# rmdir -p logs
rmdir: logs: 目錄非空
[root@localhost scf]# tree
.
|-- bin
|-- doc
|-- lib
|-- logs
|   `-- product
`-- service
    `-- deploy
        |-- info
        `-- product
 
9 directories, 0 files
[root@localhost scf]# rmdir -p logs/product
[root@localhost scf]# tree
.
|-- bin
|-- doc
|-- lib
`-- service
`-- deploy
        |-- info
        `-- product
 
7 directories, 0 files

標(biāo)簽:保山 河源 江蘇 亳州 常德 綏化 宿州 濱州

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《linux中rmdir命令使用詳解(刪除空目錄)》,本文關(guān)鍵詞  linux,中,rmdir,命令,使用,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《linux中rmdir命令使用詳解(刪除空目錄)》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于linux中rmdir命令使用詳解(刪除空目錄)的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 图们市| 茶陵县| 龙南县| 榆树市| 施秉县| 桦甸市| 彭阳县| 陵水| 苗栗市| 固镇县| 民县| 长沙市| 朔州市| 汤阴县| 正宁县| 岑溪市| 南昌县| 那曲县| 黑龙江省| 武汉市| 台江县| 富裕县| 黄山市| 二连浩特市| 虎林市| 上杭县| 玉溪市| 宜黄县| 隆回县| 青田县| 辽源市| 洛南县| 望都县| 卓尼县| 莱阳市| 金溪县| 呼图壁县| 盐城市| 安多县| 高雄市| 静宁县|