在Linux下刪除文件用rm命令,具體用法如下:
rm [選項] 文件
選項說明:
linux相關(guān)視頻教程推薦:linux視頻教程
命令實例:
1、常規(guī)刪除a.txt文件
[root]# rm a.txt
2、強行刪除file.log文件
[root]# rm -f file.log
3、刪除dirname目錄下的所有東西
[root]# rm -R dir dirname
4、刪除以 -f 開頭的文件
[root]# touch ./-f[root]# ls ./-f./-f[root]# rm ./-f
或者使用
[root]# touch -- -f [root]# ls -- -f -f[root]# rm -- -f
相關(guān)文章教程推薦:linux教程