26 comments

[ 3.1 ms ] story [ 47.4 ms ] thread
> Have you ever left your terminal logged in, only to find when you came back to it that a (supposed) friend had typed "rm -rf ~/*" and was hovering over the keyboard with threats along the lines of "lend me a fiver 'til Thursday, or I hit return"?

Wow that is really nasty, the most we did was put confusing backgrounds in, or cronjob a say "xxx is yyy" and have a laugh in the next meeting :)

Related:

Unix Recovery Legend (1986) - https://news.ycombinator.com/item?id=25491790 - Dec 2020 (97 comments)

Unix Recovery Legend (1986) - https://news.ycombinator.com/item?id=10160417 - Sept 2015 (60 comments)

Unix Recovery Legend (1986) - https://news.ycombinator.com/item?id=7892471 - June 2014 (52 comments)

Unix recovery legend - https://news.ycombinator.com/item?id=1212051 - March 2010 (83 comments)

Deja vu all over again
The internet repeats itself
I wonder whether gnuemacs of the time had the ability to create directories from Emacs lisp.
"echo *" just prints "*" on bash unfortunately.
That's its behaviour in an empty directory, but it works for me on a non-empty directory.
Oh, you're right. Never occurred to me that my home folder would be empty.
I presume you don't have a "modern desktop" installed. Hell, even Firefox spams $HOME with "Downloads".
You're right, it's WSL; so, just dotfiles.
shopt -s dotglob
Yes. Or one lowtech method I use often is `touch ~/-i`. When someone tries to rm -rf * the file called “-i” gets globbed at the front of the arguments and the subsequent command goes into “interactive “ mode meaning it prompts y/n for each file
Nice! Great "bug as a feature" trick!
What version of bash do you see this happening on? Mine works as expected.
I happened to try it in a directory with only dotfiles apparently.