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.

    • underscores@lemmy.zip
      link
      fedilink
      English
      arrow-up
      34
      arrow-down
      2
      ·
      11 days ago

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

    • Ephera@lemmy.ml
      link
      fedilink
      English
      arrow-up
      6
      ·
      11 days ago

      [OP] accidentally untarred archive intended to be extracted in root directory, which among others included some files for /etc directory.

    • palordrolap@fedia.io
      link
      fedilink
      arrow-up
      5
      ·
      11 days 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

    • WatchfulConsole@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      ·
      10 days ago

      I’ll provide some cover. This is my current home directory: bin/ bmp/ cam/ doc/ eot/ hhc/ img/ iso/ mix/ mku/ mod/ mtv/ mus/ pkg/ run/ src/ tmp/ vid/ zim/. It’s your home directory, enjoy it however you like.

    • vapeloki@lemmy.world
      link
      fedilink
      arrow-up
      1
      arrow-down
      3
      ·
      edit-2
      11 days ago

      So, you don’t do backups of /etc? Or parts of it?

      I have those tars dir ssh, pam, and portage for Gentoo systems. Quickset way to set stuff up.

      And before you start whining about ansible or puppet or what, I need those maybe 3-4 times a year to set up a temporary hardened system.

      But may, just maybe, don’t assume everyone is a fucking moron or has no idea.

      Edit Or just read what op did, I think that is pretty much the same

      • FauxLiving@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        10 days ago

        But may, just maybe, don’t assume everyone is a fucking moron or has no idea.

        Well, OP didn’t say they used Arch, btw so it’s safe to assume.

        (I hate that this needs a /s)

  • ZombieChicken@sh.itjust.works
    link
    fedilink
    arrow-up
    29
    ·
    11 days ago

    Great! Now you can enjoy that freshly assembled directory feeling, knowing that now you only have the configs in there that you need.

  • jjj@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    18
    ·
    11 days ago

    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.

    • thisbenzingring@lemmy.today
      link
      fedilink
      English
      arrow-up
      23
      ·
      11 days ago

      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

      • rumba@lemmy.zip
        link
        fedilink
        English
        arrow-up
        4
        ·
        11 days ago

        I hand-edited sudoers.conf day one on the job without using visudo

        So in one day, I learnd both how to move a volume from one AWS VM and that there’s no good reason not to use visudo.

  • woelkchen@lemmy.world
    link
    fedilink
    arrow-up
    16
    arrow-down
    2
    ·
    11 days ago

    Your first mistake was attempting to unarchive to / in the first place. Like WTF. Why would this EVER be a sane idea?

    • u/lukmly013 💾 (lemmy.sdf.org)@lemmy.sdf.orgOP
      link
      fedilink
      English
      arrow-up
      9
      ·
      11 days ago

      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.

      • vapeloki@lemmy.world
        link
        fedilink
        arrow-up
        6
        ·
        11 days ago

        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

    • palordrolap@fedia.io
      link
      fedilink
      arrow-up
      2
      ·
      11 days ago

      I’ve always just used gio trash (formerly gvfs-trash). KDE-based systems have something similar (but with syntax that’s perfectly logical but completely unsuitable, in my opinion).

      The third party trash package works in places the GUI and the aforementioned GUI-related command line tools may not. I can’t tell whether this is a bug in trash or in the system tools, TBH.

      For example, /tmp is one such directory where trash works but gio trash refuses.

      Either way, the GUI Rubbish Bin won’t keep track if things are deleted from such places by trash.

      • konomi@piefed.blahaj.zone
        link
        fedilink
        English
        arrow-up
        1
        ·
        11 days ago

        The third party trash package works in places the GUI and the aforementioned GUI-related command line tools may not. I can’t tell whether this is a bug in trash or in the system tools, TBH.

        Might be a bug I’ve never experience this issue with the trash-cli tools.

    • wabasso@lemmy.ca
      link
      fedilink
      English
      arrow-up
      5
      ·
      10 days ago

      Ok speaking of this, where do a distro’s config and boot scripts even come from? Are they in a package? Like on Debian so the .debs have metadata that can add cron jobs and such?

  • kertain@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    ·
    10 days ago

    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 :)