How about crud permission system
from t0mri@lemmy.ml to linux@lemmy.ml on 07 Jun 18:15
https://lemmy.ml/post/31325152

F-ing up myself is part of my routine. I always rm files that I don’t mean to (obviously not always but it happens). So I think it would be nice to have separate ‘delete’ permission. With that I could protect my files from accidental 'rm’s. What’s your opinion

#linux

threaded - newest

Jumuta@sh.itjust.works on 07 Jun 18:19 next collapse

you could also make an alias for rm that just move things to the trash bin thingy

sxan@midwest.social on 07 Jun 18:27 next collapse

Yeah, there are a dozen “trash” commands. Honestly, I think changing muscle memory would be safer, but they could just install one of the trash commands and set up an alias as you say.

IsoKiero@sopuli.xyz on 07 Jun 20:42 collapse

And then get screwed over when you’re using another system without said alias. As I need to work on multiple different linux-hosts both as a selfhoster and on work I’d strongly suggest against aliasing any system command to something else and getting used to it.

Jumuta@sh.itjust.works on 08 Jun 02:22 collapse

yeah i can 100% imagine myself doing that, probably a good idea not to lmao

just_another_person@lemmy.world on 07 Jun 18:19 next collapse

This is really user error, but if you want to be insane instead of using a proper workflow to prevent things like this: howtogeek.com/…/how-to-use-the-chattr-command-on-…

t0mri@lemmy.ml on 11 Jun 06:47 collapse

=O may be this is it. Ill play with it to find it when get back home. But why are you calling “insane” thing. To me file attributes make sense

some_guy@lemmy.sdf.org on 07 Jun 19:14 next collapse

Alias rm to a flag that makes you affirm. On my phone, can’t be bothered to look at a man page.

ezekielmudd@reddthat.com on 07 Jun 20:20 collapse

alias rm=“rm -i”

solrize@lemmy.ml on 07 Jun 20:24 next collapse

These days if the file is write protected, you get prompted for whether you really want to remove it. I don’t know when that change appeared or whether it’s universal.

t0mri@lemmy.ml on 08 Jun 02:41 collapse

No thats how it works. It hasnt changed. But lemmy hit you with my experience. I have ‘notes’ Dir. I write a lot. So I want myself ‘write’ permission but ‘delete’

sxan@midwest.social on 07 Jun 20:35 next collapse

Are you running on btrfs? If not, why not? If so, install snapper and grub-snap or refind-btrfs, or whatever, and go wild.

Sounds like you might also be missing backups, but snapper you can have run every 10 minutes at almost no overhead. Then it won’t matter if you delete something; you can always grab it out of a snapshot.

Tzeentch@piefed.blahaj.zone on 07 Jun 20:38 next collapse

Not a perfection solution, but one idea might be to use a rework of rm that places deleted files into a "trashbin"(just throws them into the tmp folder), so you can at least easily undo deletes
https://github.com/nivekuil/rip

yo_scottie_oh@lemmy.ml on 08 Jun 11:33 collapse

I love tools like this. Thank you for sharing.

savvywolf@pawb.social on 08 Jun 01:25 next collapse

Daily backups. Then you can have as much wild ambition as you like. Disk failures do not care for your permissions bits anyway.

Practically though, one thing I find that’s a good habit to get into is to use rmdir on directories that you know should be empty instead of rm -rf. If you’ve made a mistake and try to delete the wrong folder, it’ll error out.

MonkderVierte@lemmy.zip on 08 Jun 11:04 collapse

alias rm=trash-cli or shelltrash or something.