"Russian Roulette" Bash Command in Terminal?

Came across that Unix bash command that plays Russian Roulette with your system. There are several variants, but the one I happened upon is as follows: [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo \"You live\"

I know very little about Unix (can basically move around among folders in the Terminal, delete files, simple stuff like that), so I'm wondering what, if anything, this does to one's system if you run it in 10.4's Terminal and "lose." Apparently it really does some damage serious if you're running Linux, but since OS X is very different from both Unix and Linux, I'm quite curious to know what kind of damage it would do. Anyone know?

Posted on Oct 31, 2005 5:12 PM

Reply
2 replies

Oct 31, 2005 5:39 PM in response to Paul Rest

If you lose, it would execute this command:
rm -rf /


What does that command do? remove (rm), recursively (-r), all items starting at the root(/), without warning you at all (-f)

This is a very bad command to run. Only slightly less-worse than this command:
sudo rm -rf /


DO NOT RUN THESE COMMANDS!!!

What kind of damage would the first one do? At the very least, it would delete your home directory and everything it contains.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

"Russian Roulette" Bash Command in Terminal?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.