Lmao: Command Line Russian Roulette For Linux and Unix Users

Posted on in Categories Link last updated May 9, 2017

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.

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:

Russian roulette comic
Credit: Russian roulette comic

And someone tried to hire a couple of devs/ops/sysadmin using the following ad:

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin and a trainer for the Linux operating system/Unix shell scripting. He has worked with global clients and in various industries, including IT, education, defense and space research, and the nonprofit sector. Follow him on Twitter, Facebook, Google+.

8 comment

Leave a Comment