Lmao: Command Line Russian Roulette For Linux and Unix Users

last updated in Categories Link

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*
[ $[ $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


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:

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.


8 comment

  1. 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:

Leave a Comment