安装trash-cli
| # 更换国内源 |
| rambo@debian:~$ cat /etc/apt/sources.list |
| deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib |
| deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib |
| deb https://mirrors.aliyun.com/debian-security/ bookworm-security main |
| deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main |
| deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib |
| deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib |
| deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib |
| deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib |
| |
| deb https://mirrors.ustc.edu.cn/debian/ bookworm main non-free non-free-firmware contrib |
| deb-src https://mirrors.ustc.edu.cn/debian/ bookworm main non-free non-free-firmware contrib |
| deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main |
| deb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main |
| deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main non-free non-free-firmware contrib |
| deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-updates main non-free non-free-firmware contrib |
| deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main non-free non-free-firmware contrib |
| deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-backports main non-free non-free-firmware contrib |
| |
| |
| |
| # 创建示例文件 |
| rambo@debian:~$ echo 123 > 1.txt |
| rambo@debian:~$ mkdir opop && echo 456 > opop/2.txt |
| |
| |
| # 安装trash-cli |
| rambo@debian:~$ sudo apt-get install trash-cli |
| # 查看回收站时为空 |
| rambo@debian:~$ trash-list |
| |
| # 不建议超级用户使用这样的别名 |
| rambo@debian:~$ vim ~/.bashrc |
| alias rm=trash-put |
| |
| rambo@debian:~$ source .bashrc |
| |
| |
| # 将1.txt文件和opop目录移动到回收站中 |
| rambo@debian:~$ trash-put 1.txt opop 或者 rm -rf 1.txt opop(在做了别名的前提下可这样操作) |
| |
| # 查看回收站中已删除的文件 |
| rambo@debian:~$ trash-list |
| 2023-10-16 02:24:55 /home/rambo/1.txt |
| 2023-10-16 02:24:55 /home/rambo/opop |
| |
| # 从回收站中恢复文件或目录 |
| rambo@debian:~$ trash-restore |
| 0 2023-10-16 02:24:55 /home/rambo/1.txt |
| 1 2023-10-16 02:24:55 /home/rambo/opop |
| What file to restore [0..1]: 0 # 询问你想恢复的文件或目录,这里我选择0,即1.txt,只能使用该方式恢复 |
| |
| rambo@debian:~$ cat 1.txt |
| 123 |
| |
| |
| # 从回收站中删除文件 |
| rambo@debian:~$ trash-rm opop |
| rambo@debian:~$ trash-list # 再次查看回收站时将为空 |
| |
| |
| # 删除超过 N 天的垃圾文件:或者可删除回收站中超过 N 天的文件 |
| rambo@debian:~$ trash-empty 30 # 删除回收站中超过 10 天的文件 |
| |
| rambo@debian:~$ sudo apt-get install -y pipx |
| rambo@debian:~$ pipx install autotrash |
| # 添加到环境变量中 |
| rambo@debian:~$ pipx ensurepath |
| |
| |
| 往后的步骤需要自己来完成.... |
| |
/etc几乎包含所有配置文件,包括库的配置文件、系统的主机名和日志记录以及访问和 sudo 信息以及系统的 shell 初始化文件以及用户和组数据库,即便使用Live USB/CD,它不会有您在安装系统本身后安装的软件包或您更改的任何内容的任何配置文件
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)