rm -rf
命令會徹底刪除文件,不可恢復,警惕使用
如何實現將該刪除的文件先移除到垃圾箱
解決方案
- 下載安裝
rmtrash
下載方法是終端執行brew install rmtrash
- 在
~/.bash_profile
文件替換rm命令,在終端執行vim ~/.bash_profile
,在~/.bash_profile
文件中增加alias rm='rmtrash'
rm -rf
命令會徹底刪除文件,不可恢復,警惕使用
如何實現將該刪除的文件先移除到垃圾箱
rmtrash
下載方法是終端執行brew install rmtrash
~/.bash_profile
文件替換rm命令,在終端執行vim ~/.bash_profile
,在~/.bash_profile
文件中增加alias rm='rmtrash'