Linux安装回收站工具

在Linux上误删文件是一件很可怕的事,但是有trash-cli就不怕了

1.确定系统是否已安装Git

[root@localhost ~]# git --version
git version 1.7.1
[root@localhost ~]#

若没有安装则安装git

[root@localhost ~]# yum install git-core

2.将trash-cli克隆到本地
[root@localhost local]# git clone https://github.com/emanon-was/trash-cli.git /usr/local/trash-cli
3.配置环境变量
[root@localhost local]# export PATH=/usr/local/trash-cli/bin:$PATH
4.常用命令
删除文件 trash-put xxx.txt
查看回收站 trash-list
还原文件 trash-restore
清空回收站 trash-empty
删除回收站中文件 trash-remove xxx.txt

5.给rm创建别名,删除文件就进回收站
[root@localhost ~]# alias rm='trash-put'
[root@localhost ~]# alias rm
alias rm='trash-put'
[root@localhost ~]#

以后删除文件就可以用 rm xxx.txt 就直接移至回收站了,是不是很方便
测试一波:


最后感谢作者“emanon-was”提供工具,了解更多请参阅 https://github.com/emanon-was/trash-cli

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值