#### 1. rm [OPTION]... FILE... --- **remove files or directories - 刪除文件或目錄** #### 2. 參數(shù)選項(xiàng) --- -f(--force) 強(qiáng)制刪除,不提示確認(rèn)刪除信息、不顯示目標(biāo)不存在的信息 -r(--recursive)遞歸刪除,遞歸刪除目錄及其內(nèi)容 -v(--verbose)顯示刪除的內(nèi)容 #### 3. 常見(jiàn)用法 --- **a. 刪除指定的目錄** ```shell rm -rf 目錄名 ``` **b. 刪除指定目錄下的所有內(nèi)容** ```shell rm -rf 目錄名/* ``` **c. 刪除當(dāng)前目錄下的所有內(nèi)容** ```shell rm -rf * ``` **d. 顯示刪除的內(nèi)容** ```perl rm -rfv 目標(biāo) ``` ``` [root@localhost test]# rm -rfv dir33 removed directory: ‘dir33/dir1’ removed directory: ‘dir33/dir2’ removed directory: ‘dir33/dir3’ removed ‘dir33/2.txt’ removed ‘dir33/99.txt}’ removed ‘dir33/01/1.txt’ removed ‘dir33/01/2.txt’ removed ‘dir33/01/99.txt’ removed directory: ‘dir33/01’ removed directory: ‘dir33’ ```