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

  • Programmer Belch@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    68
    ·
    11 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.

    • berber@lemmy.chaos.berlin
      link
      fedilink
      arrow-up
      7
      ·
      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@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      11 months ago

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