command line russian roulette

[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo *Click*
5 out of 6 times its really funny.
Sample Output

By: Fuzzwah
2009-02-16 01:17:04

What Others Think

Deletes all your files 1 out of 6 times.
mysidia · 635 weeks and 2 days ago
It would be funny if someone actually tried it ;-)
stii · 635 weeks and 2 days ago
safe version :-P [ $[ $RANDOM % 6 ] == 0 ] && echo "*BANG*" || echo "*Click*" and it wouldn't delete your files 1 out of 6 times, every iteration has a 1 in 6 chance of deleting your files.
leprasmurf · 635 weeks and 1 day ago
It is funny.
Vadi · 634 weeks and 1 day ago
A pure bash way to do it : (((RANDOM%6)==0)) && rm -rf / || echo *Click*
sputnick · 620 weeks and 4 days ago
5 times over 6, this command will not work as expected if there is a file whose name starts or ends with "Click".
rbossy · 598 weeks and 6 days ago
[ $[ $RANDOM % 6 ] == 0 ] && while true; do echo \a; sleep 2; done || echo *Click*
nhutto · 493 weeks and 5 days ago
Greetings, I am certain that you have heard at any rate once in your life from a companion, a mind boggling story of winning in an online club, or winning a bet. I figure you didn't actually confide in such bits of hearsay, yet imagine a scenario where I revealed to you that this happened to me as well, and it profoundly completely changed me, when companion exhorted me this site - it is genuinely solid and doesn't impede clients who genuine cash win.
JeremyYang · 2 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: