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.

  • MonkeMischief@lemmy.today
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    3 days ago

    That’s certainly something you can do! I would personally follow the recommendation against aliasing rm though, either just using the trash tool’s auto complete or a different alias altogether.

    Reason being as someone mentioned below: You don’t want to give yourself a false sense of security or complacency with such a dangerous command, especially if you use multiple systems.

    I liken it to someone starting to handle weapons more carelessly because the one they have at home is “never loaded.” Better safe than sorry.

    Lol we should have “rules of rm safety”:

    • Assume rm is always sudo unless proven otherwise.
    • (EDIT)Finger should be off the Enter key until you are certain you are ready to delete.
    • Never point rm at something you aren’t willing to permanently destroy.
    • Always be aware of your target directory, and what is recursively behind it!