在linux中刪除文件的命令是rm,該命令還可以刪除目錄。
參數(shù)介紹:
-i 刪除前逐一詢(xún)問(wèn)確認(rèn)。
-f 即使原檔案屬性設(shè)為唯讀,亦直接刪除,無(wú)需逐一確認(rèn)。
-r 將目錄及以下之檔案亦逐一刪除。
實(shí)例:
1、刪除文件夾實(shí)例:
rm -rf /var/log/httpd/access
將會(huì)刪除/var/log/httpd/access目錄以及其下所有文件、文件夾。
2、刪除文件使用實(shí)例:
rm -f /var/log/httpd/access.log
將會(huì)強(qiáng)制刪除/var/log/httpd/access.log這個(gè)文件。
推薦教程:linux教程