What does HackerNews think of trash-cli?

Command line interface to the freedesktop.org trashcan.

Language: Python

#18 in Linux
#31 in Python
I use trash-cli which implements the freedesktop trash spec:

https://github.com/andreafrancia/trash-cli

> For example, in the command line, deleting a file doesn't send it to the "Recycle Bin" or your OS's equivalent, it simply deletes it.

Use trash-cli: https://github.com/andreafrancia/trash-cli

For Linux users: also look into the trash-cli [1] package, which complies with the FreeDesktop.org trash specification and remembers the original path, etc. so that trash items can be restored even with filename collisions. Then it's

    trash-put my_file.txt
[1] https://github.com/andreafrancia/trash-cli
I use fzf [0] with zsh. I frequently use the Ctrl-T and Ctrl-R commands for finding files and searching history, respectively. Ctrl-R without fzf is great too, but with fzf you can see more of the history than just the currently selected entry. I hardly do `history | grep` anymore.

I've also been using trash-cli [1] for years with `rm` aliased to `trash-put`. It's saved me a handful of times when I've carelessly `rm`d something I shouldn't have.

[0] https://github.com/junegunn/fzf

[1] https://github.com/andreafrancia/trash-cli - Command Line Interface to FreeDesktop.org Trash.

  apt install trash-cli
  alias rm=trash
Done? This implements the Freedesktop specification, so is compatible with what KDE and Gnome do.

https://github.com/andreafrancia/trash-cli

I do backups, of course, but I also have rm aliased to

    echo "Bad! Use `trash` instead."; return 1
and use trash-cli [1] instead, which moves the target files and folders to the Linux equivalent of the Recycle Bin. If I mess up, my files are one restore-trash command from being recovered. Every so often I trash-empty to free up space.

[1] https://github.com/andreafrancia/trash-cli

How about replacing rm with something like https://github.com/andreafrancia/trash-cli ? If you only purge the trash when it's necessary and not automatically after every rm, you'd save yourself.