17
submitted 1 week ago by [email protected] to c/[email protected]

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

top 15 comments
sorted by: hot top new old
[-] [email protected] 11 points 1 week ago

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

[-] [email protected] 11 points 1 week ago

alias rm=“rm -i”

[-] [email protected] 9 points 1 week ago* (last edited 1 week ago)

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

[-] [email protected] 2 points 1 week ago

I love tools like this. Thank you for sharing.

[-] [email protected] 5 points 1 week ago

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

[-] [email protected] 4 points 1 week ago

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.

[-] [email protected] 1 points 1 week ago

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

[-] [email protected] 1 points 1 week ago

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.

[-] [email protected] 4 points 1 week ago

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

[-] [email protected] 1 points 1 week ago* (last edited 1 week ago)

=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

[-] [email protected] 4 points 1 week ago

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.

[-] [email protected] 4 points 1 week ago

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.

[-] [email protected] 3 points 1 week ago

alias rm=trash-cli or shelltrash or something.

[-] [email protected] 1 points 1 week ago

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.

[-] [email protected] 1 points 1 week ago

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'

this post was submitted on 07 Jun 2025
17 points (79.3% liked)

Linux

55410 readers
908 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS