nixCraft Linux / UNIX Newsletter

Link to [RSS/Feed] nixCraft: Linux Tips, Hacks, Tutorials, And Ideas In Blog Format

Lmao: Command Line Russian Roulette For Linux and Unix Users

Posted: 09 May 2017 11:21 AM PDT

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:

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

Debian / Ubuntu Linux fortune cookie humor

Posted: 09 May 2017 10:59 AM PDT

Hmm…

sudo apt install fortune-mod

sudo apt install fortune-mod

PS: Check out out apt command and apt-get command cheat sheet guide.

Failed to set locale, defaulting to C warning message on CentOS Linux when running yum

Posted: 09 May 2017 10:28 AM PDT

Whenever I run yum command, I get an error or warning that read as Failed to set locale, defaulting to C. How do I fix this issue on CentOS 7 Linux server? Why do I get "Failed to set locale, defaulting to C" when using yum on CentOS 6 or Fedora Linux system? How do I fix it?

How to search for a package in Arch Linux

Posted: 09 May 2017 09:25 AM PDT

I am a new Arch Linux user. How do I search the repository for installable packages under Arch Linux using command line option?

How to add/install man pages in Alpine Linux

Posted: 09 May 2017 06:10 AM PDT

When I type the 'man ls' command in Alpine Linux, I get an error message: bash: man: command not found. How do I install and use man pages in Alpine Linux?