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

Hint: :q!
Sister communities:
Community rules (click to expand)
1. Follow the site-wide rules
sudo in Windows.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.
Reusing names of critical system directories in subdirectories in your home dir.

I agree with this take, don't wanna blame the victim but there's a lesson to be learned.
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
Oof. I always type the whole path just because I have made this mistake before.
That doesn't protect you from typos.
rm -rv /home/schmuck /etc
"Whoops, I accidentally added a space."
I have three ways around this:
ls ~/etc ... <press up arrow, replace ls with rm -rv>ls ~/etc ... rm -rv !$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.
Just get a cli trash tool and alias it to rm. Arch wiki
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":
Great! Now you can enjoy that freshly assembled directory feeling, knowing that now you only have the configs in there that you need.
Let he who has not wrongly deleted system critical files in Linux cast the first stone.
Amateurs. You all did it accidentally. I deleted system critical files intentionally believing it was beneficial.
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.
This is why you should setup daily snapshots of your system volumes.
Btrfs and ZFS exist for a reason.
βJust a little off the top pleaseβ
Things like these are right of passage on Linux :)
Is there any reason to use a root account? If you had used sudo for each privilege needing command in stead it would have stopped you.
Is there any reason to use a root account?
if you just borked your /etc and need to rebuild because you don't have sudo anymore
Your first mistake was attempting to unarchive to / in the first place. Like WTF. Why would this EVER be a sane idea?
that was my reaction when I saw a coworker put random files and directories into / of a server
I feel like some people don't have a feeling about how a file system works
I don't know if it should be a bad thing. Inside the tar archive the configs were already organized into their respective dirctories, this way with --preserve-permissions --overwrite I could just quickly add the desired versions of configs.
Some examples of contents:
-rw-r--r-- root/root 2201 2026-02-18 08:08 etc/pam.d/sshd
-rw-r--r-- root/root 399 2026-02-17 23:22 etc/pam.d/sudo
-rw-r--r-- root/root 2208 2026-02-18 09:13 etc/sysctl.conf
drwx------ user/user 0 2026-02-17 23:28 home/user/.ssh/
-rw------- user/user 205 2026-02-17 23:29 home/user/.ssh/authorized_keys
drwxrwxr-x user/user 0 2026-02-18 16:30 home/user/.vnc/
-rw-rw-r-- user/user 85 2026-02-18 15:32 home/user/.vnc/tigervnc.conf
-rw-r--r-- root/root 3553 2026-02-18 08:04 etc/ssh/sshd_config
Keeps permissions, keeps ownership, puts things where they belong (or copies from where they were), and you end up with a single file that can be stored on whatever filesystem.
Whelp, time to restore the latest snapshot.
So good to see that, even in 2026, Unix Haters' Handbook's part on rm is still valid. See page 59 of the pdf
Be happy that you didn't remeber the ~ and put a space between it and etcπ.
Genuinely curious⦠why using root for operations like these?
To feel the thrill
alias rm="rm -i"
alias rm=βecho noβ
Ahh, the rites of passage!
I am new to Linux and just getting somewhat comfortable as my daily driver, very proud of myself that I got the joke pretty quickly :)
I fucking hate using rm for these very reasons.
There's another program called "trash-cli" that gives you a trash command instead of going straight to deletion.
I'm not sure why more distros don't include it by default, or why more tutorials don't mention it.

Reminds me in the t-shirt: "don't drink and root"
it could be worse: rm -rv ~ /etc
Yeah, same thing like with unclosed bottles, cup too close to the table edge, etc.: Accidents that can hapen, will happen.
Better name them something else in your user dir.
And yes, painful experience.
never heard of ~/etcΒ
I accidentally untarred archive intended to be extracted in root directory
Reminds me of when I had a rogue ~ directory sitting in my own home directory (probably from a badly written script). Three seconds into rm -rf ~ and me wondering why it was taking so long to complete, I CTRL+C, reboot, and pray.
Alas, it was a reinstall for me that day (good excuse to distro hop, anyway). Really glad I don't mount my personal NAS folder in my home directory anymore, holy shit.