Should work as a drop-in replacement for rm but safer.
Would appreciate any feedback!
Should work as a drop-in replacement for rm but safer.
Would appreciate any feedback!
I hope it was fun.
In case you were wondering, this is at least four decades late on the invention front.
I have a small wrapper around rip2, aliased to `recycle`; files go to a `graveyard` zfs dataset. I deny `rm` usage for agents, a simple (global) instruction pointing to recycle seems to do the trick for Claude.
Seems like a quick win to remove some downside risk and make me a bit more comfortable letting agents run wild in local workspaces.
I believe some Linux distributions alias rm to either rm -i or -I in their default shell config.
$ > important-file-1.txt
$ cp crap.txt important-file-2.txt
$ ln -sf blah important-file-3.txt
$ mv crap.txt important-file-4.txt
Now what?Editor backups, git, real backups.
They usually also follow XDG, and some are cross os.
I’m currently using https://github.com/Byron/trash-rs
Supports windows, macOS and Linux.
Leftium•3d ago
- Working great on MacOS!
- For some reason the latest versions occasionally didn't work on Windows 11. (I forgot the actual reason...)
I aliased rm=trash and RM=rm so I could still access the real rm when needed.
spacebuffer•18h ago
Leftium•18h ago
I use fish shell abbreviations, now.
`rm` expands into `trash` so I know it's been "aliased."
I don't ssh into servers often, but hopefully I'd notice `rm` didn't expand.
--
On a similar note, I used to alias `cd` to zoxide. But now I just use the default `j` to avoid confusion with `cd`