跳到主要内容

linux trash

阅读需 1 分钟

trash-cli

安装

  • 安装 sudo apt install trash-cli

使用

  • trash-put: 把文件或目录移动到回收站
  • trash-empty: 清空回收站
  • trash-list: 列出回收站文件
  • trash-restore: 恢复回收站文件
  • trash-rm: 删除回收站文件

配置

  • 七天删除 (crontab -l ; echo "@daily $(which trash-empty) 7") | crontab -

    • 查看 cat /var/spool/cron/crontabs/root
  • 设置别名 alias rm='trash' (官方不推荐)

Loading Comments...