use trash-cli instead of 'rm'

访问量: 618

refer to:  https://github.com/andreafrancia/trash-cli

1. sudo apt-get install python-setuptools

2. easy_install trash-cli

3. trash-put weixin_tuling_0601/

4. change ~/.bashrc: 

alias rm='echo "rm is disabled, use \"trash\" instead. "'

5. usage:   $ trash xx_file        ,   trash xx_folder. 

6. 修改   /etc/motd  (motd = message of the day) , 来告诉每个登录的用户, trash已经生效。

xiaoguo:

2016-06-27 10:48:09 /opt/app/weixin_tuling_0626
2016-06-27 10:47:37 /opt/app/dist.zip
2016-06-27 10:47:52 /opt/app/weixin_tuling_0601
2016-06-27 10:51:50 /opt/app/tuling_20160408.sql
2016-06-27 11:10:31 /tmp/mysqldump.log
2016-06-27 11:10:07 /tmp/mysqldump.log

6. 最重要的恢复 ( 2016-9-29) 

今天终于用上了.

昨天晚上误删了 好商城 (33hao ) , 所以今天开始恢复. 

$ trash-list 列出所有的项目

$ restore-trash :  会列出可以恢复的项目,然后输入数字,例如: 

$ restore-trash | grep hao
root@iZ25kkl41woZ:/opt/app# restore-trash | grep hao
1644 2016-09-28 17:10:54 /opt/app/33hao
1768 2016-07-17 21:20:41 /opt/app/33hao.zip
# 然后直接删掉就可以:

$ restore-trash 

... 列出好多

输入: 1644    回车, 发现东西就回来了. 

订阅/RSS Feed

Subscribe

分类/category