💀☠️

  • ☂️-@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    19 hours ago

    call me paranoid or stupid but i always use the graphical file manager whenever i can to delete stuff for this very reason.

    • the rizzler@lemmygrad.ml
      link
      fedilink
      arrow-up
      1
      ·
      17 hours ago

      is there any coreutil that doesn’t have a “poweruser” rewrite in rust that does the same thing but in color

    • mech@feddit.org
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      5 hours ago

      I do the opposite. Whenever I delete anything I use rm -rf /full/path/to/file
      Just starting to type that triggers a fear response and makes me triple-check what I’m doing.

  • Nemoder@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    1 day ago

    …and this is the reason I added this to my root .bashrc:
    export PS1="\h:\$(realpath .)\$ "
    no more following symlinks on a remote mount and forgetting about it.

    • hddsx@lemmy.ca
      link
      fedilink
      arrow-up
      9
      ·
      2 days ago

      Nobody deletes “./“. It’s far far more likely to be “/ tmp/file”

      Also, without the -f it will prompt you. Chances are, the meme is with -f

      The other possibility, though I haven’t tested it, is the working directory is / and they did “rm -rf .” Without first checking with pwd. I know that most OS will refuse to remove root without passing in a special flag nowadays. Only a few OS still respect you as sudo.

      • T156@lemmy.world
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 day ago

        Though the check isn’t very sophisticated, if memory serves. It more or less checks whether / is passed to rm -r.

        If you did something like rm -r $VAR/*, but didn’t check to make sure that $VAR was set and not empty, it could still fire, since rm wouldn’t see that root got passed, only a bunch of directories in root.

  • 7U5K3N@lemmy.dbzer0.com
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    2 days ago

    Honestly I was cleaning up some docker stuff today…

    So I’m

    rm -r /mnt/NVME/opt/folder(s)

    Hit the refresh button in my gui file browser and it was still there. Lol Took a good 15 seconds for it to vanish.

    Crazy. But idk why I expected it to be instant.

  • sepi@piefed.social
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 days ago

    This is where we sort the younglings from the grizzled veterans that backup and test their backups. Haven’t lost a file since 2002.

    • Peffse@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      1 day ago

      I had a coworker preparing a customer database that arrived via sneakernet. He typo’d a variable during an rm -f step and ended up wiping the device because it was his working directory and the variable was undefined.

  • nemith@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    1 day ago

    At a previous job I remember a PR to do essentially

    temp=$(mktemp -d) mv $target $temp rm -r $temp &

    I thought it was pretty clever. Obviously you would need to make sure mktemp is on the same filesystem (there are good flags to just use a dot file in the current directory). mv is atomic on most filesystems and then the & just runs the rm in the background .