This is why you should setup daily snapshots of your system volumes.
Btrfs and ZFS exist for a reason.
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.
This is why you should setup daily snapshots of your system volumes.
Btrfs and ZFS exist for a reason.
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 !$Thankfully I don't hit the space bar randomly (yet) but btrfs snapshotting has saved the day for other mishaps
I think the bigger point is that if you type the entire path, you are obviously typing more characters, which gives more opportunities for typos, whatever they may be.
It's far safer to find ways to type less. Less typing, fewer typos. As long as you can do it safely.
I don't think that applies when you intend to type something but accidental type enter after your first slash / :)
DId you try CRTL-Z?
instructions on clear, switched to vi mode in bash and cant exit
F
(That's not going to help you, just paying my respects.)
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.
nice!
I am he. But I won't
Your first mistake was attempting to unarchive to / in the first place. Like WTF. Why would this EVER be a sane idea?
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.
I assumed something like this. That's a perfectly valid usecase for a tar extracted to /.
But I love it how people always jump to the assumption that the one on the other end is the stupid one
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
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
Whelp, time to restore the latest snapshot.

never heard of ~/etcΒ
I accidentally untarred archive intended to be extracted in root directory