1.安装过程
cd /tmp
git clone https://github.com/andreafrancia/trash-cli
cd trash-cli
sudo python setup.py install
2.检验
安装完成之后我们系统就拥有了下列工具
➜ ~ ll /usr/bin/|grep trash
-rwxr-xr-x 1 root root 123 5月 28 19:38 trash
-rwxr-xr-x 1 root root 125 5月 28 19:38 trash-empty
-rwxr-xr-x 1 root root 124 5月 28 19:38 trash-list
-rwxr-xr-x 1 root root 123 5月 28 19:38 trash-put
-rwxr-xr-x 1 root root 127 5月 28 19:38 trash-restore
-rwxr-xr-x 1 root root 122 5月 28 19:38 trash-rm
3.功能说明:
trash == trash-put == 删除
trash-empty 清空
trash-list 列出回收站
trash-restore 恢复文件
trash-rm 删除回收站中指定文件
4.配置
alias rm='echo " This is not the command you are looking for.If you really want use rm simply prepend a slash"; false'