#### 1. rm [OPTION]... FILE... --- **remove files or directories - 刪除文件或目錄** #### 2. 參數選項 --- -f(--force) 強制刪除,不提示確認刪除信息、不顯示目標不存在的信息 -r(--recursive)遞歸刪除,遞歸刪除目錄及其內容 -v(--verbose)顯示刪除的內容 #### 3. 常見用法 --- **a. 刪除指定的目錄** ```shell rm -rf 目錄名 ``` **b. 刪除指定目錄下的所有內容** ```shell rm -rf 目錄名/* ``` **c. 刪除當前目錄下的所有內容** ```shell rm -rf * ``` **d. 顯示刪除的內容** ```perl rm -rfv 目標 ``` ``` [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’ ```