Bonus points if someone warned you and you went ahead anyway.

  • tal
    link
    fedilink
    English
    arrow-up
    18
    ·
    edit-2
    3 months ago

    On Linux, about twenty-five years back, on stock Red Hat Linux (and, I suspect, all Linux distributions) the bash shell used to match .* against both . – the current directory – and .. – the parent directory.

    This means that if you ran rm -rf .* in a directory, you’d delete all the files starting with a “.” – “hidden” files in the current directory. You’d also start recursively-deleting the contents of the parent directory.

    This led to all kinds of excitement if, in a directory in your home directory, you’d try deleting all dotfiles. The rm command would also attempt to wipe out all of the contents of your home directory – all of your files. And this isn’t a system where there’s some “undo delete” option, unless you had a backup system in place (which is a good idea, but wasn’t something set up by default).

    These days, bash doesn’t do that.

    EDIT: I’d also add that that was the single major reason that I initially liked zsh, a competing shell. It didn’t do that by default.

    EDIT2: A possibly-more-applicable-today thing I also learned the hard way: “Make backups. The cost is worth it.”