V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
twfb
V2EX  ›  分享创造

写了个 Linux 上的垃圾回收站, 类似 windows

  •  
  •   twfb · 2021-05-28 14:36:57 +08:00 · 1746 次点击
    这是一个创建于 1064 天前的主题,其中的信息可能已经有所发展或是发生改变。

    个人用了挺长时间, 感觉还不错.

    项目链接: https://github.com/twfb/recycle

    第 1 条附言  ·  2022-03-10 13:36:29 +08:00

    截屏

    asciicast

    用法

    • 将文件移动到回收站: del file_path
    • 将文件从回收站恢复: undel file_path or undel trash_path
    • 永久删除垃圾文件: pdel trash_file
    • 打印回收站文件树: tt
    • 打印回收站文件树调用less显示: tl
    • 示例
      • del ~/a, del /root/a, del a, del \^a, del '^a', del 'a/*/*'
      • undel ~/a, undel /root/a, undel a, undel ~/.Trash/root/a, del 'a/*/*'
      • pdel ~/a, pdel /root/a, pdel a, pdel ~/.Trash/root/a, del 'a/*/*'
      • tt, tt ~, tl '*/*'
      • tl, tl ~, tl '*/*'
    4 条回复    2021-05-31 11:25:44 +08:00
    no1xsyzy
        1
    no1xsyzy  
       2021-05-28 15:16:36 +08:00
    trash-cli ?
    ducks
        2
    ducks  
       2021-05-30 23:00:25 +08:00
    safe-rm 用了多年,给自己一个后悔的机会 哈哈
    twfb
        3
    twfb  
    OP
       2021-05-31 11:23:35 +08:00
    @no1xsyzy 刚看了下 trash-cli 很多功能类似, 也有一些不同的地方

    trash-cli: 可以清空指定日期的垃圾文件
    py-recycle: 树的形式显示垃圾文件, 恢复命令有垃圾文件自动补全, 记录垃圾文件大小, 支持正则

    "清空指定日期的垃圾文件", 这个功能目前我还没用到, 日后再添加
    twfb
        4
    twfb  
    OP
       2021-05-31 11:25:44 +08:00
    @ducks 经常 rm 删了以后, 过了几天就后悔了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1155 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 18:28 · PVG 02:28 · LAX 11:28 · JFK 14:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.