删除文件及文件夹
- -f : 免交互删除
[root@string ~]# touch {1..9}txt
[root@string ~]# ls
1txt 2txt 4txt 6txt 8txt abc one test
1.txt 3txt 5txt 7txt 9txt bash.sh proxy.conf 系统优化.md
[root@string ~]# rm -f 1txt
[root@string ~]# ls
1.txt 3txt 5txt 7txt 9txt bash.sh proxy.conf 系统优化.md
2txt 4txt 6txt 8txt abc one test
- -i : 增加一个删除前的提示
[root@string ~]# rm -i proxy.conf
rm: remove regular file
- -r : 递归删除
# 可以多级目录删除
[root@string ~]# rm -r abc/
- 删库跑路
# rm -rf /
彻底删除根目录,不提示,系统文件损坏,系统瘫痪