• mossberg590@lemmy.world
    link
    fedilink
    arrow-up
    96
    ·
    2 months ago

    Real sys admins know this pain (rm suffers no fools) and accept the consequences of recovering from backups as pennance. No backups? Then you aren’t really a sys admin then, are you?

  • JasonDJ@lemmy.zip
    link
    fedilink
    arrow-up
    44
    arrow-down
    1
    ·
    edit-2
    2 months ago

    Don’t forget the dot files and directories. Use sudo in case of trouble…sudo rm -rf .*

    (Don’t actually do this, because some shells will take that to include . and .. recursively)

    • Scafir@discuss.tchncs.de
      link
      fedilink
      arrow-up
      30
      ·
      2 months ago

      Oh god, I never considered that .* could theoretically match ... Thanks fish for not doing that, more than likely saved my unknowing ass a couple of times

      • WhyJiffie@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        4
        ·
        2 months ago

        Because you don’t always want to delete the directory itself, to then recreate it and set the ownerships and permissions again

            • z3rOR0ne@lemmy.ml
              link
              fedilink
              arrow-up
              1
              ·
              2 months ago

              Fair enough. Why not tack on rm ./.* as well to that list? Lol. Sorry, I’m truly just curious and not trying to be a smart alec.

              • WhyJiffie@sh.itjust.works
                link
                fedilink
                English
                arrow-up
                6
                ·
                2 months ago

                with that we arrive at the original problem: depending on your shell and its configuration, .. could be part of the results of the glob expansion. so at that point why bother stepping one dir level up

  • Owl@mander.xyz
    link
    fedilink
    arrow-up
    18
    arrow-down
    1
    ·
    edit-2
    2 months ago

    US government, people

    They probably dragged a shared folder in the bin on windows or something

  • mlg@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    ·
    2 months ago

    shred is what you should be using if you really want to destroy a file, but I’m actually not sure that works well on all filesystems.

    I’m pretty sure FAT32 and NTFS leave behind partial file artifacts when you edit/append data, and especially when you physically move it around.

    It just seems inevitable you’ll leave behind deleted blocks with data, which only a fulle drive wipe would guarantee removal.