12

I accidentally untarred archive intended to be extracted in root directory, which among others included some files for /etc directory.
I went on to rm -rv ~/etc, but I quickly typed rm -rv /etc instead, and hit enter, while using a root account.

top 31 comments
sorted by: hot top controversial new old
[-] partial_accumen@lemmy.world 3 points 2 months ago

Reusing names of critical system directories in subdirectories in your home dir.

[-] underscores@lemmy.zip 4 points 2 months ago

I agree with this take, don't wanna blame the victim but there's a lesson to be learned.

[-] neatchee@piefed.social 2 points 2 months ago* (last edited 2 months ago)

except if you read the accompanying text they already stated the issue by accidentally unpacking an archive to their user directory that was intended for the root directory. that's how they got an etc dir in their user directory in the first place

[-] palordrolap@fedia.io 0 points 2 months ago

I dunno, ~/bin is a fairly common thing in my experience, not that it ends up containing many actual binaries. (The system started it, miss, honest. A quarter of the things in my system's /bin are text based.)

~/etc is seriously weird though. Never seen that before. On Debians, most of the user copies of things in /etc usually end up under ~/.local/ or at ~/.filenamehere

[-] savvywolf@pawb.social 1 points 2 months ago

I think the home directory version of etc is ~/.config as per xdg.

[-] PointyFluff@lemmy.ml 3 points 2 months ago

Dumbfuck logged in as root.

[-] ICastFist@programming.dev 2 points 2 months ago

So good to see that, even in 2026, Unix Haters' Handbook's part on rm is still valid. See page 59 of the pdf

[-] Thrydwulf@lemmy.today 2 points 2 months ago

“Just a little off the top please”

[-] statelesz@slrpnk.net 2 points 2 months ago
[-] ohshit604@sh.itjust.works 3 points 2 months ago

alias rm=“echo no”

[-] Egonallanon@feddit.uk 1 points 2 months ago

Let he who has not wrongly deleted system critical files in Linux cast the first stone.

[-] merc@sh.itjust.works 1 points 2 months ago

I can do one better. A similar 'rm' command but while a Windows disk was mounted read/write. So, 2 OSes damaged in one command.

[-] KickMeElmo@sopuli.xyz 1 points 2 months ago

Amateurs. You all did it accidentally. I deleted system critical files intentionally believing it was beneficial.

[-] HereIAm@lemmy.world 1 points 2 months ago

/dev is just all bloat with stupid recursive directories

[-] bjoern_tantau@swg-empire.de 1 points 2 months ago

Whelp, time to restore the latest snapshot.

[-] quelsh@programming.dev 1 points 2 months ago

HAH rookie, I once forgot the . before the ./

[-] BCsven@lemmy.ca 1 points 2 months ago

Oof. I always type the whole path just because I have made this mistake before.

[-] BillyClark@piefed.social 1 points 2 months ago

That doesn't protect you from typos.

rm -rv /home/schmuck /etc

"Whoops, I accidentally added a space."

I have three ways around this:

  1. ls ~/etc ... <press up arrow, replace ls with rm -rv>
  2. ls ~/etc ... rm -rv !$
  3. Add the commands to a simple script and use variables to remove the danger of a command line.
[-] brbposting@sh.itjust.works 1 points 2 months ago

As a noob, those little wrappers are great.

[-] Loce@lemmy.world 1 points 2 months ago

Things like these are right of passage on Linux :)

[-] SapphironZA@sh.itjust.works 1 points 2 months ago

This is why you should setup daily snapshots of your system volumes.

Btrfs and ZFS exist for a reason.

[-] Jakeroxs@sh.itjust.works 0 points 2 months ago

Wish ZFS didn't constantly cause my proxmox to need to be forcefully restarted after the ZFS pool crashed randomly.

[-] wylinka@szmer.info 1 points 2 months ago* (last edited 2 months ago)

I get months of uptime on a ZFS NAS, though I'm not using Proxmox. I don't think it's the filesystem's fault, you might have some hardware issue tbh. Do you have some logs?

[-] MonkeMischief@lemmy.today 0 points 2 months ago

OOOOOOOOOOOF!!

One trick I use, because I'm SUPER paranoid about this, is to mv things I intend to delete to /tmp, or make /tmp/trash or something.

That way, I can move it back if I have a "WHAT HAVE I DONE!?" moment, or it just deletes itself upon reboot.

[-] MonkderVierte@lemmy.zip 0 points 2 months ago* (last edited 2 months ago)

Just get a cli trash tool and alias it to rm. Arch wiki

[-] MonkeMischief@lemmy.today 0 points 2 months ago* (last edited 2 months ago)

That's certainly something you can do! I would personally follow the recommendation against aliasing rm though, either just using the trash tool's auto complete or a different alias altogether.

Reason being as someone mentioned below: You don't want to give yourself a false sense of security or complacency with such a dangerous command, especially if you use multiple systems.

I liken it to someone starting to handle weapons more carelessly because the one they have at home is "never loaded." Better safe than sorry.

Lol we should have "rules of rm safety":

  • Assume rm is always sudo unless proven otherwise.
  • (EDIT)Finger should be off the Enter key until you are certain you are ready to delete.
  • Never point rm at something you aren't willing to permanently destroy.
  • Always be aware of your target directory, and what is recursively behind it!
[-] rushmonke@ttrpg.network 1 points 2 months ago

Yeah, there's no need to alias it. Trash-cli comes with its own trash command.

[-] sylveon@lemmy.blahaj.zone 0 points 2 months ago

I think this is the best approach. I've created a short alias for my trash tool and also aliased rm to do nothing except print a warning. This way you train yourself to avoid using it. And if I really need it for some reason I can just type \rm.

If you want to train yourself even more effectively you can also alias rm to run sl instead :)

[-] MonkeMischief@lemmy.today 1 points 2 months ago

you can also alias rm to run sl instead :)

Choo-choo!!

Hehe I just thought of a hilariously nefarious prank: alias ls to sl. 😂

[-] TomMasz@lemmy.world 0 points 2 months ago
[-] protogen420@lemmy.blahaj.zone 1 points 2 months ago

instructions on clear, switched to vi mode in bash and cant exit

this post was submitted on 18 Feb 2026
12 points (100.0% liked)

linuxmemes

31278 readers
64 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like "every user of thing".
  • Don't get baited into back-and-forth insults. We are not animals.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
  • Don't come looking for advice, this is not the right community.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
  • 5. 🇬🇧 Language/язык/Sprache
  • This is primarily an English-speaking community. 🇬🇧🇦🇺🇺🇸
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
  • 6. (NEW!) Regarding public figuresWe all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.
  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.
  •  

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.

    founded 2 years ago
    MODERATORS