六月丁香五月婷婷,丁香五月婷婷网,欧美激情网站,日本护士xxxx,禁止18岁天天操夜夜操,18岁禁止1000免费,国产福利无码一区色费

學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 操作系統(tǒng) > Linux教程 > linux rmdir命令設(shè)置方法詳解

linux rmdir命令設(shè)置方法詳解

時(shí)間: 佳洲1085 分享

linux rmdir命令設(shè)置方法詳解

  rmdir是常用的命令,下面由學(xué)習(xí)啦小編為大家整理了rmdir命令的詳細(xì)介紹,希望大家喜歡!

  linux rmdir命令詳解

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

  1.命令格式:

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

  2.命令功能:

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

  3.命令參數(shù):

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

  -v, --verbose 顯示指令執(zhí)行過(guò)程

  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)子目錄被刪除后使它也成為空目錄的話(huà),則順便一并刪除

  命令:

  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

3572652