Option to move files to `~/.local/share/Trash/`

Bug #1940498 reported by Steven Xu
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Won't Fix

Bug Description

I've used this tool for a while now, but I'm still rather scared to use `rm -rf`. This is because the man page of this tool says it doesn't prevent `rm -f *`.

For this reason I use GUI file explorers to delete where possible instead of on the terminal.

I do frequent *Btrfs* snapshot backups. But I'm also worried that even if I restore from backup, I'm not sure if the next incremental backup will regard my copied data as a copy and not a move, thus double the backup size.

Another tool that's similar in spirit to this tool is https://github.com/kaelzhang/shell-safe-rm. That hasn't been updated in a while, since 2018/02/21. I also don't think it's too straightforward to use these both at once.

I've been wondering if it's possible to add a similar function to this tool, that is to move deleted files & folders into ``~/.local/share/Trash/`?

This would solve the copy-from-backup issue too, as then I don't need to restore from backups on accidental deletion.

Steven Xu (stevenxxiu)
description: updated
Revision history for this message
François Marier (fmarier) wrote :

Interesting, that looks like a more modern version of the other approaches I mention in the README file: https://git.launchpad.net/safe-rm/tree/README.md#n41

I agree with you that it would be tricky to use both at the same time since they are both installed in the same way (i.e. a shell alias). I can certainly understand the desire to combine both approaches into a single tool.

With safe-rm (my version), what I set out to achieve was something that could be installed by default on every machine. Something that would never get in the way, except to prevent a little disaster. Changing the semantics of the rm command (to move to a trashcan) is an entirely valid but different use-case.

It would more or less involve porting shell-safe-rm to Rust and then integrating all of that code. This is not something that I would use myself, but I think it would a worthwhile thing for someone to either write a wrapper around both tools, or to extend shell-safe-rm so that it can use /usr/share/safe-rm/bin/rm instead of /bin/rm as the real command to run.

I'm marking this as a wontfix, not because I think it's a bad idea, but just to reflect the fact that I'm not likely to ever make this happen myself.

Changed in safe-rm:
status: New → Won't Fix
Revision history for this message
Steven Xu (stevenxxiu) wrote (last edit ):

Thanks for look at this.

Would you be interested if I ported shell-safe-rm to Rust and submit some pull request? I like Rust a lot better than shell scripts.

In order to not get in the way, I could add a flag for the `rm` wrapper to use this functionality.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers