Show HN: rm-safely – A shell alias that moves files to trash instead of deleting

2 zdkaster 1 9/4/2025, 7:08:29 AM github.com ↗
I made rm-safely, a simple shell wrapper that moves files to trash instead of permanently deleting them. It prevents accidental deletions from autocomplete mishaps or hasty rm -rf commands.

Should work as a drop-in replacement for rm but safer.

Would appreciate any feedback!

Comments (1)

Leftium · 2h ago
This moves files to the actual OS system trash/recycle bin: https://www.npmjs.com/package/trash-cli

- 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.