4 ms·
I use trash-cli [0] for that. [0] https://github.com/andreafrancia/trash-cli https://github.com/andreafrancia/trash-cli
by BerislavLopac 4y ago
I use trash-cli [0] for that.
[0] https://github.com/andreafrancia/trash-cli https://github.com/andreafrancia/trash-cli
- Zamicol 4y ago>Can I alias rm to trash-put? You can but you shouldn't. In the early days I thought it was a good idea to do that but now I changed my mind. Although the interface of trash-put seems to be compatible with rm, it has different semantics which will cause you problems. For example, while rm requires -R for deleting directories trash-put does not.
- mekster 4y agoI have aliased "rm" with "trash-put" for years and I just can't believe anyone is living without a trash capability under CLI. What kind of ancient environment is it without a trash capability? That's pre Windows 95. How are people handling the mistake of "rm *" in a wrong folder? Added benefit of trash-put is, you don't need "-r" to delete a folder. It's just an annoyance from user's perspective. If you think there's a compatibility problem in a script, just use /bin/rm and stop wasting time pulling hairs on unrecoverable deletion. "@daily trash-empty 30" Put this in cron to purge trashes older than 30 days daily.
- kseistrup 4y agoAnother implementation is `garbage`: https://git.sr.ht/~mzhang/garbage https://git.sr.ht/~mzhang/garbage It is written in a compiled language and appears to be faster on my old computer.