I had my canonical rm -rf / moment.

Posted by Strazza02@reddit | linux | View on Reddit | 70 comments

Not as bad to be fair as a real rm -rf / but not much better either. So pacman was misbehaving (kept failing downloads) so a quick search revealed users fix that by deleting what's inside /var/cache/pacman/pkg

Fine, I'm not really a Linux expert but what could go wrong, it's just a cache, right? But see, the folder had a ton of files so I thought it was finally time to use the terminal instead of dolphin, so I've written a quick and easy rm -rf var/cache/pacman/pkg which would've been completely fine, BUT I was unsure if I was remembering the command correctly and (funnily enough) I was scared of something going wrong and deleting everything (LOL). So I've made yet another quick search but in the hurry I've made the stupid mistake of reading that pos of the AI summary and it said:

To ensure hidden files are also removed, use:

rm -rf /path/to/folder/{*,.*}

Oh nice, there probably are hidden files in there, let me paste {*,.*} at the end and the rest is correct so send... (turns around to take the phone)

Wait... why is it removing that folder it shouldn't be there...

To cut short, when I ctrl+C'd it already had more than 100 lines on screen. I do not have a Download folder anymore, my themes are gone, my personal folder on the desktop too, hell every folder in my /home is empty, including the folder that I've setup as a mounting point for my secondary SSD that had 800GB of stuff in there... it's empty now.

So yeah I'm a dumbass, and PLEASE for the love of god, never copy-paste stuff from the AI summary ever.

Now you can have a well deserved laugh at me, or drop you rm disaster to make me feel better Xd