3 ms·
It reminds me of the Russian Linux Roulette... [ $[ $RANDOM % 6] = 0 ] && rm -rf / || echo '*Click*' But it's a bit boring. So there's also an improved ve
by segfaultbuserr 6y ago
It reminds me of the Russian Linux Roulette...
[ $[ $RANDOM % 6] = 0 ] && rm -rf / || echo '*Click*'
But it's a bit boring. So there's also an improved version [0], which deletes a random file from the system instead of everything.
alias roulette='[ $[ $RANDOM % 6 ] == 0 ] && rm -f $(shuf -n1 -e *) && echo "BOOM" || echo *Click*'
[0] https://gist.github.com/mjkaufer/85bb5f800525245942a8 https://gist.github.com/mjkaufer/85bb5f800525245942a8
- garaetjjte 6y agoFirst one requires --no-preserve-root to be effective on GNU tools ;)
- segfaultbuserr 6y agoThere's a more elegant solution: rm -rf /* Just an extra asterisk is enough. The shell expands it to all subdirectories under /, and it's compatible with all Unix systems.
- ezrast 6y agoWildcard expansion skips filenames beginning with a dot, though.
- mixmastamyk 6y agoThere's no useful ones at the root level however.
- ezrast 6y agoHaving a place to store files where they won't get deleted when you make a typo sounds useful to me.