Lmao: Command Line Russian Roulette For Linux and Unix Users

Russian Roulette is a fatal game of chance in which a player places a single round in a revolver, spins the cylinder, places the muzzle against their head, and pulls the trigger.

Advertisement

WARNING! Do not execute any commands mentioned here, as they may result in data loss. The author and nixCraft shall not be held responsible for any damage caused. Always keep verified backups.

Command line Russian Roulette for Linux and Unix system

Of course, you can play such game on your Linux or Unix server too (don’t run the following commands on your PC/MacOS/Unix/Linux system as it will delete everything):

[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo *Click*

OR

[ $[ $RANDOM % 6 ] == 0 ] && rm -rf --no-preserve-root / || echo *Click*

Above shell kung-fu deletes all your files one out of six times. Hence, you must not run it in production. Here is a safe version:

 [ $[ $RANDOM % 6 ] == 0 ] && echo '*Oh nooo*' || echo '*Click*'

Command Line Russian Roulette Comic

Of course, there is a comic too:

Or

Do not run this on your production server

Do not run this on your production server

And someone tried to hire a couple of devs/ops/sysadmin using the following Ad:
Lmao: Command Line Russian Roulette For Linux and Unix Users

Click to enlarge

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

11 comments… add one
  • Tarcsányi László May 9, 2017 @ 19:46

    This was the first thing what came into my mind:

    https://devnull-as-a-service.com/one-less-to-go.sh

  • Tarcsányi László May 9, 2017 @ 19:48

    Hm are we not allowed to use url in comment?
    If yes some error message would be good.
    About this post this was the first thing what came into my mind:
    devnull-as-a-service.com/one-less-to-go.sh

  • M. R. May 10, 2017 @ 1:55

    Have faith in Cloud and thou shalt live again.

  • Matt May 10, 2017 @ 2:41

    Had to try it on quick vm just to see how many spins I could last. Just 2

  • Raj May 10, 2017 @ 6:49

    This is funny. I laughed so hard.

  • Mike Fields May 10, 2017 @ 12:00

    Billboard used assignment instead of equality check. They do need to make a hire.

  • Jd Daniel May 10, 2017 @ 19:15

    should be: [ $(( $RANDOM % 6 )) == 0 ] && …

    just fyi ;)

  • Justin May 10, 2017 @ 21:55

    Well doesn’t this depend on your current working directory? Seems like it should cd to / ?

    • Anonymous Jan 4, 2024 @ 18:53

      It removes / if you are unlucky, so no need to cd to it

  • a Feb 10, 2021 @ 7:56

    This is a worse Russian roulette, because doing this can break the hardware.

    alias Russian_roulette='dd if=/dev/urandom of=/dev/mem seek=$((4096*RANDOM+4096*32768*RANDOM))'
    
  • donotdoit Feb 11, 2022 @ 14:39

    wahahahaha

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.