Linux(Ubuntu)使用日记------trash-cli防止误删文件

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' 

 参考博客: https://blog.phpgao.com/linux-trash-cli.html

原文地址:https://www.cnblogs.com/hwtblog/p/8508747.html