

Rm -rf - fs111
http://www.justpasha.org/folk/rm.html

======
sunkencity
I've seen a pro sysadmin deal with the loss of all device files on a linux box
by just uuencoding them in one terminal on a working machine and then pasting
them into the other terminal and piping them back from standard in. Pretty
impressive and not even breaking sweat.

------
nailer
I've been using Linux for 8 hours a day for 13 years and never done this. I
use GNU's alternate syntax, which is easier:

    
    
       rm [object] [options]
    

Eg,

    
    
       rm /var/tmp/foo -rf
    

If you hit enter too early, nothing bad happens. Obviously doesn't work on
HPUX, Solaris, DGUX or Ultrix, but if you're using those you have other
issues.

~~~
bellybutton
I always put a comment at the beginning of nontrivial commands, so
accidentally hitting enter prematurely doesn't do anything and so I can check
it once it's written out before removing the comment and hitting enter.

------
philjackson
I once wrote a variation of Larry Wall's file renamer
([http://snipplr.com/view/2677/rename--larry-walls-filename-
fi...](http://snipplr.com/view/2677/rename--larry-walls-filename-fixer/)) and
called it 'rn'.

It's now called 'rename.pl'.

------
jdietrich
Maybe it's me being an old weirdy beardy, but what's with all the oooooold
hacker folklore on HN recently? I keep expecting to see someone post 'more
magic'. Can we not just post a link to the Jargon File and be done with it?

~~~
sp332
Fine. <http://news.ycombinator.com/item?id=1295076>

------
wtn
See also: <http://news.ycombinator.com/item?id=1212051>

------
olivier101
I once typed rm -rf /bin instead of rm -rf bin on AIX. I Ctrl-C'ed quickly but
all commands in /bin beginning with A and B and some C had vanished... The big
problem is that the huge majority of AIX commands rely on awk, which had
vanished together with all A's... Eventually had to reinstall system from
tape.

------
rm-rf
Had a similar thing happen the first time I used a GUI to admin a Linux box. I
had a fresh install and was doing my usual post-install hardening (removing
unneeded packages & users).

The GUI had a checkbox for removing the users home directory. Things were
going good until I removed the user 'mail' whose home directory was '/'.

Doh!

------
rsl7
Not a very scalable solution, but if there is a file named -X where X is any
option to rm, * will expand to catch it, and if illegal, rm will exit without
doing anything. Someone taught me that in college back in the day
(sequent/dynix).

------
ulrich
Today I would boot a Knoppix, backup all user data and make a full reinstall.

~~~
dalore
The goal was to not have any major downtime.

~~~
jrockway
That goal went out the window when you erased most of the machine.

------
steveklabnik
Every time I read this story, I feel upset when I think about how many people
tell me I'm "good with the command line."

Maybe someday I'll ascend to UNIX godhood... I know that I'd have been screwed
in this situation.

------
lsb
With virtualized machines, you can make a hot backup every day, so if
something egregious like this happens on a virtualized machine you can (at
most) lose a day's work.

~~~
jrockway
You can do this on real machines, too, with LVM2 snapshots.

