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.

ADVERTISEMENTS

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:

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
8 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 / ?

Leave a Reply

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

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.