4 ms·
I’ve not been physically hurt but lessons were learnt : A friend of mine once gave me an old computer (I don’t remember exactly but it was some random Compaq r
by pjerem 5y ago
I’ve not been physically hurt but lessons were learnt :
A friend of mine once gave me an old computer (I don’t remember exactly but it was some random Compaq running Windows 98 and this happened in ~2010). I installed some distro in it but tbh, it was barely usable.
I decided it was a great opportunity to see with my own eyes what would happen when you intentionally « sudo rm -rf /* ».
Well, no surprise, it erases everything. Conscientiously. Recursively. Including the mounting point of the USB hard drive where I stored my hobbies projects. Including the network share of my other computer’s /home.
No real harm if you don’t account the dehydration from sweating.
- rochak 5y agoSo much for curiosity. I still believe it must have been worth it though :)
- eCa 5y agoSimilar lesson a decade earlier: Linux seems interesting, how to install on my Windows machine? First step: Run fdisk. Done. The most painful part was the hundreds of photos I just had finished scanning. At least I got quite good at scanning photos..
- busymom0 5y ago> Including the network share of my other computer’s /home. TIL network shares also get deleted in recursive deletions.
- teddyh 5y agoThere’s a reason that modern ‘rm’ has a “--one-file-system” option.
- Nextgrid 5y agoUnlike on Windows where each drive has its own letter (so I don't think it's possible to create a path including all drives), in Linux the filesystem originates from "/" and any additional drives or network shares are "mounted" into folders within that parent filesystem, so recursively deleting everything from the parent would also affect everything else.
- teddyh 5y agoWindows also has mounts onto subfolders.
- swiley 5y agoIn college I knew the GNU Coreutils rm had the --no-preserve root option and that my friends didn't know about this. So for fun I ran `sudo rm -rf /` just to show off or something. Unfortunately I had busybox rm earlier in my $PATH and it started chugging through my files.
- Fnoord 5y agoI remember doing something similar a long time ago (~22 years ago), and it'd actually stop removing files at some point because it deleted a file it required for the rm operation. Though I might be mixing it up with dd. And then there was that one infamous time in Debian libc broke in Testing/Unstable. Suddenly literally every application, minor or big, was broken (everything used libc).