Lmao: Command Line Russian Roulette For Linux and Unix Users

Posted on in Categories Link last updated August 2, 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

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:

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.

Share this on (or read 8 comments/add one below):

8 comment

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

  2. 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

Comments are closed.