Linux安裝資源回收筒工具__Linux

來源:互聯網
上載者:User

在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

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.