trash-cli设置Linux 回收站

news/2024/7/1 9:40:18

trash-cli 设置 Linux 回收站

trash-cli是一个使用 python 开发的软件包,包含 trash-put、restore-trash、trash-list、trash-empty、trash-rm等命令,我们可以通过这条命令,将文件移动到回收站,或者还原删除了的文件。

trash-cli的项目地址:https://github.com/andreafrancia/trash-cli

系统:CentOS 6.8

  • 安装
下载地址:https://github.com/andreafrancia/trash-cli
cd /tmp
unzip trash-cli-master.zip
cd trash-cli-master
python setup.py install

安装过程

[root@node1 trash-cli-0.17.1.14]# python setup.py install
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/trashcli
copying trashcli/trash.py -> build/lib/trashcli
copying trashcli/list.py -> build/lib/trashcli
copying trashcli/empty.py -> build/lib/trashcli
copying trashcli/list_mount_points.py -> build/lib/trashcli
copying trashcli/rm.py -> build/lib/trashcli
copying trashcli/__init__.py -> build/lib/trashcli
copying trashcli/put.py -> build/lib/trashcli
copying trashcli/fstab.py -> build/lib/trashcli
copying trashcli/restore.py -> build/lib/trashcli
copying trashcli/fs.py -> build/lib/trashcli
copying trashcli/cmds.py -> build/lib/trashcli
running build_scripts
creating build/scripts-2.6
copying and adjusting trash -> build/scripts-2.6
copying and adjusting trash-put -> build/scripts-2.6
copying and adjusting trash-list -> build/scripts-2.6
copying and adjusting trash-restore -> build/scripts-2.6
copying and adjusting trash-empty -> build/scripts-2.6
copying and adjusting trash-rm -> build/scripts-2.6
changing mode of build/scripts-2.6/trash from 644 to 755
changing mode of build/scripts-2.6/trash-put from 644 to 755
changing mode of build/scripts-2.6/trash-list from 644 to 755
changing mode of build/scripts-2.6/trash-restore from 644 to 755
changing mode of build/scripts-2.6/trash-empty from 644 to 755
changing mode of build/scripts-2.6/trash-rm from 644 to 755
running install_lib
creating /usr/lib/python2.6/site-packages/trashcli
copying build/lib/trashcli/trash.py -> /usr/lib/python2.6/site-packages/trashcli
copying build/lib/trashcli/list.py -> /usr/lib/python2.6/site-packages/trashcli
copying build/lib/trashcli/empty.py -> /usr/lib/python2.6/site-packages/trashcli
copying build/lib/trashcli/list_mount_points.py -> /usr/lib/python2.6/site-packages/trashcli
copying build/lib/trashcli/rm.py -> /usr/lib/python2.6/site-packages/trashcli
copying build/lib/trashcli/__init__.py -> /usr/lib/python2.6/site-packages/trashcli
copying build/lib/trashcli/put.py -> /usr/lib/python2.6/site-packages/trashcli
copying build/lib/trashcli/fstab.py -> /usr/lib/python2.6/site-packages/trashcli
copying build/lib/trashcli/restore.py -> /usr/lib/python2.6/site-packages/trashcli
copying build/lib/trashcli/fs.py -> /usr/lib/python2.6/site-packages/trashcli
copying build/lib/trashcli/cmds.py -> /usr/lib/python2.6/site-packages/trashcli
byte-compiling /usr/lib/python2.6/site-packages/trashcli/trash.py to trash.pyc
byte-compiling /usr/lib/python2.6/site-packages/trashcli/list.py to list.pyc
byte-compiling /usr/lib/python2.6/site-packages/trashcli/empty.py to empty.pyc
byte-compiling /usr/lib/python2.6/site-packages/trashcli/list_mount_points.py to list_mount_points.pyc
byte-compiling /usr/lib/python2.6/site-packages/trashcli/rm.py to rm.pyc
byte-compiling /usr/lib/python2.6/site-packages/trashcli/__init__.py to __init__.pyc
byte-compiling /usr/lib/python2.6/site-packages/trashcli/put.py to put.pyc
byte-compiling /usr/lib/python2.6/site-packages/trashcli/fstab.py to fstab.pyc
byte-compiling /usr/lib/python2.6/site-packages/trashcli/restore.py to restore.pyc
byte-compiling /usr/lib/python2.6/site-packages/trashcli/fs.py to fs.pyc
byte-compiling /usr/lib/python2.6/site-packages/trashcli/cmds.py to cmds.pyc
running install_scripts
copying build/scripts-2.6/trash-rm -> /usr/bin
copying build/scripts-2.6/trash-list -> /usr/bin
copying build/scripts-2.6/trash-put -> /usr/bin
copying build/scripts-2.6/trash -> /usr/bin
copying build/scripts-2.6/trash-restore -> /usr/bin
copying build/scripts-2.6/trash-empty -> /usr/bin
changing mode of /usr/bin/trash-rm to 755
changing mode of /usr/bin/trash-list to 755
changing mode of /usr/bin/trash-put to 755
changing mode of /usr/bin/trash to 755
changing mode of /usr/bin/trash-restore to 755
changing mode of /usr/bin/trash-empty to 755
running install_data
copying man/man1/trash-empty.1 -> /usr/share/man/man1
copying man/man1/trash-list.1 -> /usr/share/man/man1
copying man/man1/trash-restore.1 -> /usr/share/man/man1
copying man/man1/trash-put.1 -> /usr/share/man/man1
copying man/man1/trash-rm.1 -> /usr/share/man/man1
running install_egg_info
Writing /usr/lib/python2.6/site-packages/trash_cli-0.17.1.14-py2.6.egg-info
[root@node1 trash-cli-0.17.1.14]#
  • 安装成功后我们的系统就有了以下工具.
[root@node1 ~]# ll /usr/bin/|grep trash
-rwxr-xr-x    1 root root        123 2月  18 15:26 trash
-rwxr-xr-x    1 root root        125 2月  18 15:26 trash-empty
-rwxr-xr-x    1 root root        124 2月  18 15:26 trash-list
-rwxr-xr-x    1 root root        123 2月  18 15:26 trash-put
-rwxr-xr-x    1 root root        127 2月  18 15:26 trash-restore
-rwxr-xr-x    1 root root        122 2月  18 15:26 trash-rm
[root@node1 ~]#
  • 功能说明
命令概览:trash-put          将文件或目录移入回收站trash-empty        清空回收站trash-list         列出回收站中的文件trash-restore      还原回收站中的文件trash-rm           删除回首站中的单个文件
  • 用它替代 rm命令
[root@node1 ~]# vim /etc/.bashrc
# 添加下面一行
alias rm=”trush-put”

使修改的别名生效:

[root@node1 ~]# source /etc/bashrc

默认存放路径:/~/.local/share/Trash/files/

转载于:https://blog.51cto.com/moerjinrong/2351347


http://lihuaxi.xjx100.cn/news/236198.html

相关文章

nginx安全日志分析脚本的编写

https://blog.csdn.net/nextdoor6/article/details/51914966

计算机操作培训主持词,魅力女性沙龙会主持词文稿.docx

魅力女性沙龙会主持词??性的学科、一项重要的经济管理工作,是加强经济管理,提高经济效益的重要手段, 经济管理离不开会计, 经济越发展会计工作就显得越重要。会计工作在提高经济在企业的经营管理中起着重要的作用,其…

封装 vue 组件的过程记录

在我们使用vue的开发过程中总会遇到这样的场景,封装自己的业务组件。 封装页面组件前要考虑几个问题:1、该业务组件的使用场景 2、在什么条件下展示一些什么数据,数据类型是什么样的,及长度颜色等 3、如果是通用的内容&#xff0c…

只需3分钟,就能轻松创建 一个SpreadJS的React项目

概述SpreadJS 纯前端表格控件 V11.2(SP2) 已经全面支持了 React 的拓展。接下来我们看下如何利用3分钟快速创建一个 SpreadJS 的 React 项目。1.新建React 项目(耗时 1 Min)直接运行:npx create-react-app react-spread-sheets还不清楚什么是…

streptavidin-PEG-TRITC 链霉亲和素-聚乙二醇-四甲基罗丹明

产品名称:链霉亲和素-聚乙二醇-四甲基罗丹明 英文名称:streptavidin-PEG-TRITC 纯度:95% 存储条件:-20C,避光,避湿 外观:固体或粘性液体,取决于分子量 PEG分子量可选:350、550、750、…

计算机设备管理器不显示com,台式机设备管理器打开是空白怎么办_win10设备管理无法显示解决方法...

2015-06-15 14:08:22  浏览量:2252win7设备管理器空白怎么办?最近有用户反馈打开设备管理器的时候,发现win7设备管理器显示空白,该怎么处理这个问题?下面跟随小编脚步一起看看win7系统打开设备管理器空白的解决方法。…

安利Mastodon:属于未来的社交网络

我为Mastodon开发了一款安卓客户端,v1.0版本已经发布,欢迎下载使用 源码在这里:https://github.com/shuiRong/Gakki ??? 正文 Mastodon(长毛象)是什么? 是一个免费开源、去中心化、分布式的微博客社交网络,是微博、…

OSS正式支持IPv6公测

背景 6月20日阿里云宣布全面支持IPv6, 随后阿里云开放对象存储OSS也逐步开始向用户公测。 公测步骤 正常使用IPv6服务,除了OSS端支持还需要客户端支持,我们做一些检查证明客户端具备访问 IPv6的能力,再使用OSS SDK或工具通过IPv6 …