
Ooops. - peteretep
https://github.com/MrMEEE/bumblebee/commit/a047be85247755cdbe0acce6#diff-1
======
srean
I learned a rather unusual trick to keep myself safe from unintended glob
matches. It is not "fool"-proof, but it will probably dilute an unmitigated
disaster into an incomplete disaster: Keep a file named -i in the sensitive
directories. When glob picks it up, which should be fairly early, it will be
treated like a command line argument. Has saved me on occasions.

I also had a friend in school who used to, for whatever reasons, name his
files using characters drawn from a pool of only two characters. One being "."
the other "*". Please don't ask me why. He would then try to delete some
particular file. You can well imagine what would happen next. This happened
multiple times, till I went ahead and populated his directories with "-i"
files. That worked great.

I usually keep rm aliased to 'rm -i', but once I did get burned. It was not
because of hitting return early but because of having a space between a
directory and the trailing "/".....while running rm as root. It was taking a
bit longer than I had imagined, so I looked again at the prompt to see what
had I typed..$#@!&~ :)

~~~
trafficlight
I hate that feeling you get in the pit of your stomach after you realize
what's happening.

Same thing when you forget the WHERE on a DELETE FROM.

~~~
jerf
Over the years I've been steadily training myself to type "WHERE" earlier in
the process, until I have finally settled on the obvious-in-hindsight
solution: Always simply _start_ with the WHERE clause.

(Of course every effort not to be on the SQL shell of a production server in
the first place should be taken, but sometimes you need a sledgehammer and
nothing else will work.)

~~~
samstokes
The habit I learned was: before running any DELETE or UPDATE statement, run a
SELECT with the same WHERE. (e.g. if I meant to say DELETE FROM puppies WHERE
cute = 0, first run SELECT FROM puppies WHERE cute = 0.)

I find I remember to do that because of the direct benefit (getting a sneak
preview of what I'm going to delete), but it also means I end up thinking
twice about the WHERE statement, so I'm much less likely to miss it out or get
it dramatically wrong.

~~~
DrPhish
I'm a couple of levels more paranoid than that. First, I'll write the DELETE
as a regular SELECT (to preview number of rows), then turn it into a SELECT
INTO to save the soon-to-be-deleted rows into a table with a backup_date_
prefix (So old backups can be deleted occasionally). Next, before changing
anything, I wrap the statement in a BEGIN TRAN, and ROLLBACK TRAN. After all
that, I will finally modify the SELECT INTO into a DELETE statement, run it
once while wrapped in the transaction (to verify that the number of rows
modified hasn't changed), and then finally run without the transaction to
delete the rows. Overkill?

~~~
trafficlight
Possibly overkill. But at least there won't be any tears.

------
shrikant
Perhaps because I'm not a GitHub user, and because I've only ever peeked at
HNers' GitHub accounts, but I was always under the impression that given the
nature of the service, it would have an early-days-of-HN feel wrt to user
behaviour.

It was a little disheartening to see the number of Reddit-esque comments that
are simply a couple of words along the lines of "omfg" and a constant stream
of meme abuse. I expected better from the programming community.

Sigh. Am I just becoming old, jaded and too elitist for my own good?

~~~
monochromatic
It's like reading Youtube comments--not for the faint of heart.

And the jab at reddit from the HN pedestal is probably misguided... reddit
used to be more like HN, and HN is becoming more like the bad parts of reddit
every day.

Every site tends toward Youtube level comments as time passes, and the people
who don't like it eventually jump ship to a new site, and then the process
repeats itself.

~~~
dclowd9901
"And the jab at reddit from the HN pedestal is probably misguided... reddit
used to be more like HN, and HN is becoming more like the bad parts of reddit
every day."

But you just did the same thing...

~~~
monochromatic
Not really the same thing. I'm saying that HN shouldn't look down its nose at
reddit, since it appears to be heading the same direction. I'm taking a jab at
_both_ sites (and all sites, really).

------
crikli
The reason we all know to be careful with rm -r is because of that one time we
weren't.

Me, it was the time I rm r'ed the MySQL data directory for my company's
customer service management system. Oops. Thankfully we had a backup from the
month prior, but I learned two things that day: a) be really careful with rm
and b) take it on yourself to make sure IT is backing up stuff that you're
messing with.

You gotta hedge against your own stupid.

What about you, how'd you learn the hard way?

~~~
illumin8
Was asked to uninstall IBM/Rational ClearCase from our source code repository
server. Apparently at the time, Clearcase's installer NFS mounted 127.0.0.1:/
to a subdirectory. Don't ask me what brain-dead system designer thought this
was a good idea.

So, I did a simple /etc/init.d/clearcase stop (not sure that is the exact
name) and:

# rm -rf /opt/clearcase

(hmm... that seems to be taking a little too long to run)

Panic - then ctrl-C - it was too late, /opt/clearcase/foo was NFS mounted
127.0.0.1:/ and it had already trashed /bin, /sbin, /etc, /var, and most of
/usr.

Luckily I had good backups, but we did spend the rest of the day rebuilding
the source repository while the developers couldn't check in any code.

~~~
mst
One of my first tasks after being given root access at my first _n?x job at an
ISP was "clear off all of the DNS stuff on $main_server since we have
$dedicated_dns_server now".

So I merrily started mv-ing things to a scratch directory that we could wipe
in 6 months if we didn't need anything from it.

Unfortunately, the zone file directory was NFS mounted _from*
$dedicated_dns_server. With pass root set.

I think I took all of A through to K of client zones offline before we
noticed.

I'm just very very glad I decided to do it as an mv rather than an rm, since
it meant all I needed to do was copy things back.

Not that I really learned my lesson that time; it took a couple more semi-
disasters before I got sufficiently paranoid to be reasonably safe as root.

~~~
redthrowaway
Too late now, but remember to escape your asterices.

------
tlrobinson
I've started quoting arguments in shell scripts even when it's not technically
necessary to avoid problems with spaces. I can't count how many scripts I've
written/encountered that didn't work with a path containing a space
(apparently much more common with OS X users than Linux users)

This wouldn't delete the correct directory, but at least it won't delete
"/usr" either:

    
    
        rm -rf "/usr /lib/nvidia-current/xorg/xorg"
    

There are lots of other pitfalls associated with not quoting things in shell
scripts, like this common one:

    
    
        if [ $foo -eq "bar" ];
    

will cause an error if $foo isn't set or is an empty string, while this will
work correctly:

    
    
        if [ "$foo" -eq "bar" ];
    

Bonus that your syntax highlighter can highlight the arguments. My rule is
that flags aren't quoted, but paths and other parameters are.

~~~
whacker
I always use set -eu. Makes my scripts much safer and less unpredictable.

------
jrockway
I don't remember the exact details, but a few years ago there was a Perl
module that did something like:

    
    
       my $path = something_that_can_return_undef_on_failure;
       `rm -rf /$path`;
    

during the execution of its test suite. The author didn't catch it in testing
because he never ran "make test" as root (who would?). But people on the
Internet ran "make test" as root, with disastrous consequences.

~~~
SwellJoe
I'm not sure if you're being sarcastic with the "who would?" portion of your
comment, but doesn't cpan run tests, by default, whenever installing
something? And, most people who aren't Perl developers with their own private
Perl installation install CPAN modules as root, so they are available to all
users. So, to answer the question seriously: Most people.

~~~
jrockway
Uh, the cpan client runs "make install" as root, not "make test".

------
bradly
Here is the original bug report.
<https://github.com/MrMEEE/bumblebee/issues/123>

I've never heard of BumbleBee, but it must be great if a user can have their
machine wiped out and still thank the library author for their work.

~~~
callahad
The other bug reports linked in the commit are kind of sad. From 122:

"I thinking that something is messed up with bashrc or sh because in few
seconds I cannot execute any command in other terminal.

Am I doing something wrong? Hope You can help me."

<https://github.com/MrMEEE/bumblebee/issues/122>

------
nickolai
reminds me of

<http://thedailywtf.com/Articles/Bourne-Into-Oblivion.aspx>

~~~
Splines
When you design something and the default case is to shoot yourself in the
foot, you should stop and rethink things.

------
jefffoster
I use the safe-rm (<http://freshmeat.net/projects/safe-rm>) package to help me
avoid doing this kind of thing.

~~~
troutwine
Do you not find that a lack of wide installation limits its usefulness?

~~~
jefffoster
I just use it for my boxes. It doesn't stop me putting something silly in a
make file (as in the example here), but it does stop me getting burnt by it.

~~~
troutwine
I see; thank you.

------
tomkarlo
Back in the late 90s I worked on a small Windows product... our CEO complained
that when the uninstaller ran, it left the empty directory behind along with
some small temp files created by the software (that the package hadn't put
there during install). So the guy making the package added a command to remove
the directory and its contents...

... and the first reporter to try software, for reasons I'll never totally
understand, chose to install it in C:\\. Worked great until he went to
uninstall it.

------
chops
I've done a similar thing a few years ago when I was first starting work on my
guild hosting company's code.

At the time, the main thing hosted on that machine was my WoW guild's website,
which I had been working on for close to a year, and was beginning work on
converting the site over to a general purpose guild hosting site.

I was doing some work for a client, setting up a mirror of sorts for some kind
of yearbook thing I had built for them. For that, I made a script that would
mirror the online yearbook with wget, zip up the whole directory, then clear
out the mirrored pages (all I cared to store and serve was the zip file).

All of my websites were stored in /www on the server, and the raw yearbook was
located at /www/clientname/www. Inside the clientname directory, I had the
mirror script which was something like this:

    
    
      wget -whatever_options http://whatever.address www
      zip yearbook.zip www
      rm -fr /www
    

Unfortunately, because of how frequently I type / before www to get to my web
dev directory, I instinctively put "/www" in the script where I just wanted to
do "www". I ran the script, checked to make sure and it looked good, and
deployed it to a cronjob.

My heart sank when I tried loading my guild page a few minutes later (just to
see what was going on on the forum, if anything), and it served up a bunch of
404s.

I went to /www/guildsite and saw it completely empty, and almost immediately
figured out what had happened. At that point, I had to get my composure and
figure out what I was going to do (I did not have backups or source control).
I unmounted the directory, and went off to lunch with a friend, shaking with
anxiety.

Upon return, I started writing out a perl script to scour the device byte for
byte looking for PHP scripts, looking for instances of <? and then capturing
the following 2000 lines or so, assuming that would be a sufficient buffer.
When the script was done, I set it to run on the partition, and 45 minutes
later I had a few hundred files to work with.

I had to manually go through every file (which were named numerically in the
order they were found in the filesystem) and determine if it was the most
recent (or recent enough) copy of the code, clear off any trailing bytes, and
rename it to the filename it used to have. Luckily I could remember the name
of almost every file in the system. It took about 8 hours to go through the
few hundred files and recover them.

Needless to say, I learned my lesson after that, but the feeling of victory I
got from recovering those files from the device was epic.

6 years later, I realize that that's a rather trivial thing to do, but at the
time, I didn't know what I was going to do, and remembering that the file
system doesn't clear all the bytes of the a file just it's reference gave me
tons of hope.

~~~
Vivtek
_I've done a similar thing a few years ago_

Ha - I'll bet _everybody here_ has a story that starts like that. (Although
your heroic save was heroic!)

My sad delete story was in 1982 - I had a fantastic graphical robot-vs.-robot
game stored on tape on an HP portable computer (I was in high school). For
some reason, the delete command on the HP had a variant that deleted from a
given block forward on the tape, as I recall, and for some other reason, my
fingers just decided to type that variant even though I had never done it
before.

I still miss that game. It just may have grown in my memory, but I'm pretty
sure that was the _coolest piece of software ever written anywhere at any
time_.

~~~
noonespecial
Mine was plugging in the power connector backwards on a super important ide
drive (it was the only backup for an already failed server) and watching smoke
issue from its controller board.

Having to explain what I'd done to the boss was so scary, I slunk home with
the drive and traced the power circuit with my oscilloscope until I found a
capacitor that had blown short. I soldered on a through-hole replacement and
it worked!

I pulled the data and felt like king of the whole frikkin world for the next
week or so.

~~~
bphogan
My gosh that's one of the best stories I've heard in a long time. The thing
that worries me is that things like this are going to me rarer and rarer -
there seems to be less interest in electronics, and less electronics that can
be hack-fixed like that.

~~~
X-Istence
I am a software engineer by degree, but also took many electrical engineering
courses in uni, and I can honestly say that it is starting to make a comeback.
Sparkfun, Adafruit, MAKE and many other places are starting to make it more
accessible, cheaper and easy to learn. The Arduino has been a boon, providing
people with a cheap but powerful microcontroller to get started.

While yes technology is getting smaller I have found that with many parts I
can now easily find replacements online, I can get advice from other
professionals, I can easily figure out how something works so that I can fix
it. I've currently got a power supply sitting on my work bench that has a
weird issue and I am slowly going through, making a net list and building a
schematic with part numbers in an attempt to isolate the fault.

Maybe I am a rare breed, but seeing as how the interest at Maker Faire keeps
going up, and interest in electronics also keep going up I will assume that
eventually more and more people will get into experimenting in this field.

At least that is my hope.

~~~
axelator
arduino FTW! just getting into it and caused my first electrical fire. :-)
good stories.

------
yesimahuman
This terrifies me now of every single install script that refuses to run if
not root.

~~~
thomas11
With a bug like this, an install script without root permissions can still
wipe out your $HOME when messing around in the dotfiles. Scary!

~~~
billswift
That is why I keep a second home directory, /home/experimental for trying
things out.

------
JoachimSchipper
It's a pretty messy script anyway - rm'ing /usr/lib/nvidia-current/xorg/xorg
doesn't strike me as the most delicate approach to the problem.

------
mootothemax
This release fixes the install script; it no longer deletes the /usr directory
in its entirety. But how on earth did this get through even basic testing?
Absolutely shocking!

~~~
latch
Seems non-trivial to test. First, its in a bash install script - i wouldn't
know where to start. Second, if you tested the behavior, you might just test
that it "deletes /urs/lib/nvidia-current/xorg/xorg" by running the install
script and checking that the folder is gone. Guess what, the folder _is_
gone...test passes.

------
Jach
A couple months ago I had to recover some rm'd files by basically grepping
512-byte blocks on the file system for the file headers then writing out the
next few KB to a file on a separate partition to manually go through..

My command sequence was more like this though, rather than a straight rm:

    
    
        find -name '*.java' | xargs grep --color 'something'
        # guh, get rid of these old copied .svn dirs polluting output
        find -name '.svn' | xargs rm -rf
        # now what was that..
        find -name '*.java' | xargs rm -rf
    

Forgot to edit the right side of the pipe back to the grep. Zealous use of the
up-arrow burned me...

------
JonnieCache
While we're on the subject, has anyone successfully found/created a
replacement for rm on OS X that moves files to the trash, but doesn't break
the interface of rm for use in scripts?

~~~
neanderdog
rmtrash

<http://www.nightproductions.net/cli.htm>

I prefer 'brew install rmtrash'

~~~
JonnieCache
There's lots of stuff like that out there, I'm talking about something I can
actually _replace_ the rm binary with, a wrapper that precisely maintains the
rm interface as described here:
[http://developer.apple.com/library/mac/#documentation/Darwin...](http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/rm.1.html)

I like the idea of actually wrapping the unlink syscall, but I have no idea
if/how darwin allows that.

~~~
ordinary
You can alias trash-cli over rm, though it ignores -i, -r and -f and instead
runs recursively, forced and non-interactively by default.

------
shabble
I only recently discovered molly-guard:

<http://packages.debian.org/sid/molly-guard>

which prevents you from running halt/shutdown etc. via SSH without first
confirming the hostname.

I've done that before with pretty traumatic consequences, so it's now on my
list of must-have's for any important remote box.

<http://www.catb.org/jargon/html/M/molly-guard.html>

------
phaedrus
rm is like a knife where the handle has a sharp edge too...

~~~
Trufa
A double edge knife/sword?

~~~
AretNCarlsen
"Double-edged sword" has never worked for me, as a cliche. Do you often find
yourself inadvertently smacking against the dull side of a single-edged sword,
such that you stay away from double-edged swords for your own safety? rm is
like a double- _ended_ knife, i.e.:
[http://image.shutterstock.com/display_pic_with_logo/4253/425...](http://image.shutterstock.com/display_pic_with_logo/4253/4253,1131019295,1/stock-
photo-double-bladed-throwing-knife-686738.jpg)

(Fun fact: many knife throwers grip the blade end anyway, rendering the cliche
to an even simpler "rm is like a knife".)

~~~
philwelch
I had a friend who actually knew proper sword technique, and he was not
impressed by my machete with saw teeth on the other edge. With a single-edged
sword you can use your forearm to support it when blocking, but with a double
edged sword, not only can you not do that, but trying to block with the sword
itself allows your opponent to overpower you and press your own sword against
you.

~~~
daeken
For what it's worth, you can use your arm to support it if you're armored as
well. If you're in chainmail/plate, the force is distributed well enough that
there's no reason you can't do this, even with a double-edged weapon. That
said, there are many swordfighting styles where armor hinders you
significantly, and you frequently see single-edged weapons in these. It's
actually really interesting to study the history of swords, their techniques,
and the armor commonly used along side them -- used to have a really good book
about this, but can't find it now.

------
levesque
I actually ran that piece of code. Sure was glad it was only on a test
partition. I did lose some trust in the developers after this, _but_ I tried
bumblebee again later and am happy I did because it works great!

I forgive them.

------
delinka
Never use rm's -f flag while operating as the root user. Never. Replace with
-i until you are absolutely 100% certain the script you're writing works as
expected. Always doubt yourself; be humble.

~~~
nathanb
The -I flag is a bit more friendly; one may safely alias rm to rm -I and not
even notice on the common case (deleting a single file).

~~~
billswift
I use a script that moves a file to a ~/.trash directory when I use rm. If I
am sure I want to actually delete a file permanently I just use /bin/rm.

~~~
nathanb
Sounds like a great way to fill up your disk to me.

~~~
presto8
You could use a cron job that removes the "deleted" files after some period,
such as 30 days.

------
creativeembassy
I had a hard drive crash on me once, and I wasn't that worried about it,
because I had setup network-based backup to the server in a different room. I
remember thinking, "Restoring this backup will be sooo much easier if I can
just connect it directly to the PC." Que me walking with the backup HDD
towards the PC in question, when I drop it on the floor. When I plugged it in,
it literally bounced inside of the chassis (platters fell off motor or
something).

------
cool-RR
Is there a good reason why Linux doesn't have a recycle bin?

~~~
trustfundbaby
<sarcasm>because _real_ Operating systems don't need one?</sarcasm>

~~~
cool-RR
That's what I thought. I'd be happy if anyone chimed in with a legitimate
reason, but I won't be surprised if the lack of a recycling bin is just one
more symptom of the Linux developer community's apathy towards the actual
human beings who use their software.

~~~
uxp
I would speculate that it is a historical reason. It's no secret that the Unix
environment was not designed for personal use in homes, but on mainframe time
shared computers inside universities and businesses. Space was limited, and
just moving files to another location to deal with later added unnecessary
steps to a process that didn't have much of a benefit, at the time.

As space has become less valuable on computers, and they have become less of a
specialized tool, it may be wise to add one, but most of the desktop
environments already implement it already so there is no need to recreate the
functionality at a lower level.

~~~
cool-RR
_there is no need to recreate the functionality at a lower level._

I refer you to the original submission.

~~~
evilduck
Care to provide any example of an OS that would prevent this? Windows and OSX
both have this same fault.

~~~
cool-RR
I don't have an example, I'm just thinking what's the best way for an OS to
handle deletion.

------
getsat
Looks like someone never read the Unix Hater's Handbook. Another fun thing is
rm + shell expansion. A file named * or / can cause extremely unintended
deletions.

~~~
zerd
Files can be named anything but / in Unix.

~~~
pwnguin
I'm pretty sure there's a file named /

------
leif
I keep /usr in a squashfs, mounted with aufs over top of it, for the 0.01%
speedup I probably get (I grew up on gentoo, forgive me). Periodically, I need
to rebuild the squashfs to reclaim space in the aufs writable directory.

I once had a script something like this:

    
    
        mksquashfs /usr /squashed/usr/usr_tmp.sfs -b 65536
        umount -l /usr
        umount -l /squashed/usr/ro
        rm /squashed/usr/usr.sfs
        mv /squashed/usr/usr_tmp.sfs /squashed/usr/usr.sfs
        rm -rf /squashed/usr/rw/*
        mount /squashed/usr/ro
        mount /usr
    

Guess what happens if you hit Ctrl-C during the mksquashfs? That's right, bash
runs all the rest too, including the deletion of the old squashfs file. I was
left without a /usr, and it was brutal. Managed to recover (it's incredible
how resilient a linux system is, as long as /bin and /lib are intact), and
immediately put "set -e" in almost every bash script on my machine (I also
fixed the script to keep the system in a recoverable state at all times...).

------
DenisM
You get in trouble not at the moment this happens, you get in trouble much
earlier than that - when you allow yourself into a situation where a single
typo leads to ruin.

Myself, I use TimeMachine and bitbucket on my Mac, and every-15-minutes
snapshots on all Amazon EC2 EBS volumes. Similar solutions can certainly be
found for your platform of choice.

------
monological
1000 points really? This is on par with initial tsunamii news.

------
fmx
The designer of rm is the greater culprit here, not the author of that install
script. A single mistyped character should not lead to such drastic
consequences.

"Usability? What's that? I'm really smart, so I don't make mistakes. If lesser
humans do - that's their problem". That seems to be the attitude of many Linux
programs and rm is among the worst of them. No doubt I'll get downvoted for
saying this, but I've rarely, if ever, heard of such things happening in
Windows. (And people still manage to delete files in Windows without too much
difficulty.)

------
dools
The two sure fire ways to live a long and happy life:

1\. find . -name " _pattern_ " <enter> <look carefully> <up arrow> | sudo
xargs rm -f

2\. WHERE some_id = 36; <home> DELETE FROM table_name

------
sambeau
Unix could really do with a command that you can wrap around this type of
call. Either a sanity check on the path part or a safe rm alternative that
contains it. I would gladly give up full rm access to know that I can safely
(or safer-ly) delete in scripts.

It could be something as simple as a file with paths on each line it - match
one path or a path with a glob - and the script fails before destroying
anything important.

Overriding it might involve adding a --override=/path/to/something but at
least then it would be very explicit

~~~
sambeau
Ah. It seems I have just described 'safe-rm'.

Great minds etc :)

~~~
fmarier
Indeed. Those were exactly the design goals I had when I wrote safe-rm
(shortly after deleting my /usr/lib!).

------
orenmazor
just tried to explain this to a few of my windows using coworkers.

~~~
stephen_g
Just tell them it's the same as a Windows installer accidentally removing the
entire Program Files directory.

~~~
arethuza
I knew someone who, in the days of Windows 3.1, managed to accidentally invoke
"format c:" from inside Microsoft Word - I was in the same room as them when
they did it and heard the cries for help. What they couldn't do was explain to
me what they had done to accompish such a feat.

~~~
statictype
As Windows was probably installed on C it probably didn't do any real damage,
did it?

~~~
srdjanjovcic
If I remember correctly, that was before Windows started protecting boot
volume.

~~~
yuhong
To be more precise, NT had file locking enforced by the OS unlike DOS.

------
sigil
This tip only applies to interactive shells: I often prefix potentially
dangerous commands with '#' while I edit them. Tab-completion still works
(with bash at least, so I assume also with certain other vastly superior
shells).

    
    
        # rm -rf /path/to/^I

------
wladimir
Reminds me of some slackware install script back in 1999 or so, I think it was
for the gnome documentation.

Anyway, it accidentally removed rm-rf'ed /, I only discovered it in time
because it gave errors about removing nodes in /proc...

------
TheEzEzz
(I'm not a Linux user, forgive my ignorance)

Is there no way to prevent bugs like this at the source, by modifying Linux,
rather than hoping there isn't any extra white space in a command that might
delete your usr directory?

------
eran
Once we got catastrophic backup

rsync -a --delete /home/project/ /mnt/backupDisk

Left unnecessary slash after "project" and rewrite all content on "backupDisk"
by project files (instead of sync project folder on it)

------
Garbage
[http://www.google.com/codesearch#search/&q=%22rm%20-rf%2...](http://www.google.com/codesearch#search/&q=%22rm%20-rf%20/%20%22&type=cs)

------
rektide
linux can still boot without a /usr. this was a commit; how many people ran
it?

on the other hand, delete the boot.ini[1] and most windows systems cant even
boot. now deploy that boot.ini deleting build on an MMO (eve online) and watch
the fur fly. that, ladies and gentlemen, is how you earn a :golfclap:.

[1] <http://google.com/search?q=ccp+boot.ini>

------
damoncali
This would be a lot funnier if there was anything preventing me from doing
exactly the same thing... ouch.

------
hyperbovine
That's pretty heinous, but deleting /usr shouldn't cause you to lose any
irreplaceable data.

~~~
jonhohle
From the FreeBSD handbook ( <http://www.freebsd.org/doc/handbook/users-
introduction.html>):

    
    
        The home directory is the full path to a directory on the system in
        which the user will start when logging on to the system. A common
        convention is to put all user home directories under /home/username
        or /usr/home/username. The user would store their personal
        files in their home directory, and any directories they may create
        in there.
    

All of my irreplaceable data is stored in `/usr'. `/home' is a symlink to
`/usr/home', as created by the installer.

------
indrora
Oh man.

an RPM I had at one point had / as one of its trees. There's a reason I moved
to debian.

------
jcarreiro
I wonder if this is what the founders of github expected from "social coding"?

------
ch0wn
That poor guy. But I appreciate the reminder to double-check any rm command.

------
ltamake
That's quite a big bug. :/

------
fedd
and it was 666 points a second ago. symbolic.

------
yoyoyogi
glad it wasn't me..

------
earl
A decade ago, I worked on a DNA sequencer / aligner product. This produced
easily 1GB+ raw data files, and they typically exploded by a factor of ten by
the time you performed a bunch of cleaning, smoothing, filtering, etc on them.
For several reasons, not least of which was a 4GB file size limit in fat32,
this software had to use a directory as a pseudo file.

I was working on some file saving logic. A customer had a problem where they'd
overlaid a new logical file on top of an old logical file. Where these actual
files, this would just have overwritten the old file, but since these were
directories, we got a mishmash of pieces of two different logical files
overlaid in the same directory, and of course our software got confused as
hell. So, I wrote code that, in case you saved a new file as an extent
filename (really directory name), would perform the equivalent of

    
    
      rm -rf $dirname; mkdir $dirname;
    

You can see where this is going... Some grad student didn't understand this,
and named a pseudo file as the root directory of a tree of research. Two years
of research vanished into the ether, despite a dialog box that had red text in
it. That sucked.

~~~
aw3c2
It is crazy not to have backups of research data.

------
hackermom
<rm -rfi> -i interactive mode man is here to save the day - now you can put up
to 50% more blame on the end-user!

------
danso
I hate languages with significant whitespace

~~~
dfranke
The "significant whitespace" here is a space between command-line arguments.
For that to qualify, you'd also have to include C as such a language.

    
    
      long jmp();
      longjmp();

~~~
danso
c'mon everyone, I was being facetious :)

------
Yhippa
Das ist nein gut.

------
gm
lol, f*ckups don't get any bigger than this

------
malux85
OHHHHHHHHHHHH wow .... great link, passed around the office for a few laughs
... this is one of those heart sinking moments ....

