rm -r *
I was waiting for a friend in the lobby of the Hilton down at Union Square. Near me was a middle-aged woman speaking loudly into a pay phone.
"Yes, yes, that's right. You've got it. Now, here's what I want you to type. 'are em' ... yes. The letter 'r' and the letter 'm', together. Now type a dash. Yes, like a hyphen. OK, and then another 'r'. Yes rm space hyphen r. OK, now another space and then a star. Shift 8. Yes. Now read it back to me. [pause] OK perfect. Hit return and tell me what happens. [pause] [pause] OK. Thank you. Goodbye."
And she hung up and walked away while the command-line geek inside of me stood paralyzed with fear.
This entry was written by Jeffrey Veen and posted 27 June 2006 at 9:17 PM. It was filed under Technology.
Oh that's beautiful :)
At work we've kind of renamed that command. When spoken it comes out something like "arr-em-dash-arr-star-hands-off-keyboard-stop-and-think" :)
Dear God.
Without sudo, you can't do damage to the system, other than sending his/her own files to wonderland. :)
Sweet mercy.
Sending a user's own files into the toilet sure sounds like damage to me. "The system" is the part that 3rd party geeks care about. =)
With sudo and "/"?
O(T) Hope you enjoy Google, Jeff
There's a certain clarity that comes soon, very soon, after hitting Enter.
Scenarios:
1) Disgruntled former employee/lover "helping" one last time.
2) Consultant "helping" client who never paid the consultant's bill.
3) Legitimate need to delete files (was there a pwd before you started listening?).
4) BOFH crank call.
Or, maybe everyone's right, and it's an ohno moment in the wild.
Yeah, I remember hearing way back in the day someone prank calling clueless windows users with the equivalent. deltree or some DOS POS like that. They were taking it a step farther, though, including some commands to keep quiet and never ask for confirmation...
I remember when I was a first year at university, seeing this final year who looked like he'd lost his mind.
After 48 hours solid coding and writing his dissertation, he had rm -r * to remove a bunch of temp files. Then realised he was not only logged in as root, but also in /
Poor lad.
Destroying evidence.
In college (1995-6), I worked at an Egghead Software. We would always get the "my computer won't work" calls right before closing time. One night, a lady calls with the same old question about some software she just bought. Windows 95 was what most people were running so I asked her if she could get to a command-prompt. She could. Tired and ready to go home, I jokingly told her to type "format c:". Before I could tell her it was a joke, she said thanks and hung up. Never heard from her again.
Sweat-inducing. I took the bullet out of the chamber in my bash profile:
alias rm='rm -i'
ok, scary.
and how weird to use a payphone?
see, this is why normal people don't like geeks.
If she'd been on a cell phone---and a woman who knows what that command does absolutely has a cell phone---then OK, she's a consultant/coder/geek who got a sky-is-falling call from the office on her lunch hour. But on a pay phone? She's making sure she can't be traced. Notice how quickly she hung up and vamoosed after the deed was done. Girlfriend's up to no good.
Adding to Nathan Gilliatt's scenarios:
5) It was former White House communications director Nicolle Wallace
6) It was an aide to former White House speech writer Michael Gerson
7) It was an aide to former White House Chief of Staff Andrew Card
8) It was an aide to former White House Press Secretary Scott McClellan
9) It was an aide to former White House Treasury Secretary John Snow
Yesss... unless it was just a very hardcore "in lieu of resignation letter" I would say that was a "The Justice Dept is in the Lobby" call from her secretary.
...and somewhere in the midwest, a missile silo door opened.
In college we used linux in the computer science labs. As a joke, my friends and I would went into the "introduction to programming" lab and wrote on the board, "to read your mail really fast, use the command rm -rf". I know it was a mean thing to do, but it was super funny at the time.
only in sanfran...
Isn't it possible that the person on the other side of the phone actually wanted their files to be deleted? Why is everyone assuming otherwise?
Um, Merlin?
> Sweat-inducing. I took the bullet out of the
> chamber in my bash profile:> alias rm='rm -i'
'-f' overrides '-i'.
First thought was that since you didn't hear the start of the phone call that would have most likely included a cd to change directory, and a pwd statement for confirmation, she was probably instructing on how to for example delete a collection of photo images. That way more data could fit on whatever storage medium they are using. In that scenario and many other likely ones similar to it, the only surprising aspect is that you were struck by fear.
my first thought was the same as #23, but she ends by saying "thanks." So it seems like she is requesting this to be done, not being asked for help. If she were telling the person what to do after being asked she would have ended with "you're welcome"
my first thought was the same as #23, but she ends by saying "thanks." So it seems like she is requesting this to be done, not being asked for help. If she were telling the person what to do after being asked she would have ended with "you're welcome"
could have been /tmp
Man this completely made my day. Not everyday you over here this on a pay phone, (but some of the old school UNIX geeks I know can't stand cell phone)s. But, the comments here are worth every penny.
Could be she just tried a new Linux install and it borked. She needed to tell her mother what to type in so that it would have a clean drive to start with when she got back home.
#1 stated it beautifully, always stop and think, and think clearly when rm is involved. Worked with a couple sys admins with fast fingers that caused them a lot of swearing and diving for the electrical cords.
Now imagine if you'd been sitting in a computer lab and heard the other end of the conversation. :-)
"R and M? Together?"
"Dash - is that anything like a hyphen?"
"So it's R, M, hyphen, R?"
"Where's the star key?"
"Oh, there it is! Like an asterisk."
"R M, hyphen R, star. Is that right?"
"Okay, I hit return, and it's just sitting there."
"Oh wait, whoa, whoa, what's happening!? Where did -- what THE HECK!? OH MY GOD! I'M GONNA KILL YOU! NO, DON'T YOU DARE HANG UP YOU B--"
<click>
C'mon you noobs! :)
'rm -rf /'
or ... better yet (depending on various THANGS) 'sudo rm -rf /'
Um, genehack?
>'-f' overrides '-i'.
Try again. She didn't say '-f'.
Depends what directory they were in ...
And no, aliassing rm to `rm -i' is stupid. There'll always be the day when you're on another box without it, so you might as well get used to it now. Machines that do what you say? Whatever next?
I wonder if she's possibly reading this and laughing her butt off since she's the only one that knows what really happened...
dalroth5:
Yep, you're right, my bad.
If she was malicious, wouldn't she have put -rf in?
Also, aren't we just wierded out more by the payphone?
Man, sometimes we made errors... I remember last year: I was connected to a server through SSH and need to change the permissions for a directory and I executed:
chown -R user .
After pressing the ENTER key... it was so surreal... I realized I was at /
You can bet I was paralyzed. It was too late for Ctrl-C. Get a taxi and run to the Data Center... at least I was a couple of hours from there and not half a planet...
Well, on my system i have a nice alias for 'rm -rf' that expresses exactly what it does :)
It is, though, a bit embarrassing to use it on directories that have women's names...
where have all my files gone?
format c: /u /autotest
:)
No warning, no unformat data retained, no verification, just the sound of millions of bytes being ripped screaming from the arms of mother DOS.
I remember my dad telling me about an admin at a place he worked a long time ago (although not quite in a galaxy far away) who had two bad habits that were even worse together. First, he would always leave himself logged in as root. Second, in order to deactivate the screensaver feature of his console, he'd hit enter a few times.
Once when he had left his desk for a while, my dad went to his terminal and typed in something along the lines of:
echo "something bad will happen in ";for i in 3 2 1; do echo -n "$i "; done; echo; echo rm -rf /
and left it on the command line. (leaving out that last echo would have been mean and dangerous, and when you're not expecting to have to understand a line of shell script, 3 seconds isn't long enough to fully parse that line, but is long enough to scare the bejesus out of you.)
Geez....Joe's dad didn't even know enough to use
echo "\n\n rm -rf /"
useless use of echo...
So, John, you're saying that you have a .history with some of the women at work? :-D
On a system we had there were ampersand named files.
An administrator was trying to get rid of one.
She sent us the command she typed and her opinion:
rm -r /&SAVEDLISTS/&
"I think I mis-typed the slashes."
Nothing like committing the ultimate sin AND putting it into the background!
It was 28 hours to rebuild the system.
Ooo that's soo cool, is Condoleeza Rice as comanding in person as she appears to be on C-Span?
like a large stone
in a stream your files
are gone
She might have just been telling someone how to empty ~/.Trash/ on a Mac. Sometimes the gets convinced that a file in the Trash Can is in use, even though it isn't, and cd ~/.Trash; rm -r * is the only way to make it empty.
I don't about you but I always use
"rm -rf *"
just to ensure total carnage :-)I just remember stumbling across a server that someone left without logging out as a root. The best joke I could think of was to check that the shell running is bash and then typing:
"# rm -rf /" (return)
Unfortunately I didn't have time to wait and observe the reactions :-)
My own tragic story...
$ su
$ cd /usr/local/apache/htdocs
$ mkdir old
$ mv *.html old
...do a bunch of stuff...
$ mv old/* .Unfortunately, I accidentally typed that last line with an extra space:
$ mv old /* .
Sigh.
Joe, that'd go through the countdown a lot faster than 3 seconds ;)
Throw a "sleep 1" in the loop somewhere.
zsh by default warns you when you type rm -r *
You can even set the environment variable RM_STAR_WAIT to ignore your answer for the first ten seconds to avoid reflexively answering yes.I believe tcsh has a similar behavior when you set rmstar.
#35 reminds me of one of my shining moments. Wrote a script to remove one version of mysql for another on a recently installed fedora box... long story short I deleted everything in /sbin and /bin (possibly /usr/bin and /usr/sbin too, I can't really remember)...
[root@mail2 home]# ls
-bash: ls: command not found
[root@mail2 home]# yum
-bash: yum: command not foundHm... shit. This box is 60 minutes away, and locked in an office I have absolutely no access to, on a consulting gig that I had just landed.
I was luckily able to recover it though. Since ssh was still running, i was able to download the rpm's to get yum and its dependancies working, unpack the rpm's, scp -r the files into thier rightful locations, and then finally do an in place upgrade from fedora 2 to fedora 3. Never even had to reboot the box, it was beautiful.
Was definitely relieved when that night was over... If anything I learned its slightly a good idea to test scripts before running... just because you *think* it will do one thing doesn't mean it *will*
--sharpone
alot of noise for a 70's command overheard from a phone line conversation...
Coming to the conversation late, but anyway... many, many moons ago I had a Sparc IPC that I had (ill-advisedly) decided to upgrade from SunOS 4.1.3 to Solaris 5 (a real dog on those machines, even at the time).
Seeing the opportunity, I su'ed to root and 'rm -rf /'.
It was very interesting - I was reminded of "2001" when HAL's memory was going. I've been meaning to load up a VMWare with a recent Linux distro and see how it goes.
I once wrote a blog entry about these three little words and the agony they caused me. My sympathies to everyone who suffered this before too.
Oh, if we want to play pranks, then note that some shells / TERMs don't actually display ^C when you press it, so it's easy to leave it on the penultimate line. Or you could press M-RET instead of RET to insert a blank line, too...
I worked at a newspaper a while back where the owner was also basically one of the unix admins. They ran an all SunOS shop with custom software.
On a photo workstation, a user could accidentally save large photo files in / if they weren't careful. The owner/admin got tired of being called at 4 a.m. (just before deadline) for a full disk because someone had filled up the root partition.
So, he added a cron job to find all files in / newer than date X and delete them. This worked great until we rebuilt the kernel. A few months later, when the machine needed to be rebooted, it wouldn't come up. Finally, we brought it up and realized the kernel was missing, so we just recompiled and shrugged our shoulders.
A few months later, when it rebooted again ... we did the same thing.
I think it was a full year and at least 3 reboots before we realized what was going on.
Of course, I've also rm -rf'ed-up a few times myself. But one of my favorite noob admin mistakes I used to do (before I knew how to use /etc/skel or similar setups):
create user
copy my various dotfiles into their dir
cd into dir
chmod -R user .*(which of course included "..")
The source you are relating to:
http://www.pvv.ntnu.no/~steinl/vitser/rm.html
Also has this:
http://www.pvv.ntnu.no/~steinl/vitser/sex.htmlI kinda don't take it all too serious now...
But I'll try on my friends phone for sure! ;)
are em negative are ?
Re: #42
One of those rare UniVerse systems. The & files always made me nervous.
This had me scared for a minute.
avast antivirus' Web Shield currently detects AM Mike's command line as a Trojan Horse.
I had to turn it off to see this page. *sigh*
rm -rf * would have worked better. Any semi-geek knows that r is for recursive, but f forces it to delete.
I did that once. I thought I was somewhere else (like ~ or something) as we all - who did that - do, and did a rm * on / It was a SCO Unix box, the company did a restore and I pissed everybody off by, oh, like 5 hours.... Ouch.. This was about 10 years ago and I HAVE really learnt my lesson since then... No honest... =)
A friend's friend was testing a finished program, created a folder named "*" just to see what the program would do - and deleted it. He said it dawned to him what he was doing before he hit the enter, but it was too late. Lost countless of hours worth of work.
I was actually so horrified when I first heard the story that since then I've always thought twice with rm.
Maybe it was just to flush out a directory? At least it wasn't "rm -rf /"
I once had an old Mac (OS X) that crashed during system install, and there wasn't enough space left on the hard drive for a full reinstall again without deleting everything - and I didn't want to delete the user accounts. So I started rm -rf'ing every system-related directory I could think of, but for some silly reason, I started with /usr and /bin. Next directory came up "-bash: rm: command not found." Oops.
Luckily that freed up enough space that I didn't have to boot from another hard drive and start over. Hey, it was fun.
Oh, and my guess is that she was an engineer for Diebold.
Jeez... Just remembered the bug in iTunes (was it 4?) where someone had forgot a ' in the install script. It supposedly resulted in a full wipe of the harddrive with sudo privileges. And thinking back that I was _that_ close to install it. Here's to reading MacinTouch!
Heck if I was gonna do that to someone, I'd want to use a payphone to be as untraceable as possible. Yipe.
evelish :)
on console write
rm -rf *;
then lots of spaces until next line and now type
x@x:~/$and then let the guy do the damage himself :)
So, like, lemmee get this: "Recusive remove" is like, recursive remove, only worse? Wow.
Ouch, the payphone bit is perfect. Reminds me how back in the early 80s, my best friend & i would go down to Lechmere at the mall and interrupt whatever demos were being run in the computer dept, then type "format c:" into as many as we could before quickly walking out of the store... I can't say how many times we did it, but we must've given the salespeople quite a bit of overtime...
WHAT REALLY HAPPENED
I am a middle-aged woman, and the other day as a joke I picked up the handpiece of the pay phone in the lobby of the Hilton down at Union Square and talked into it. Cos a number of computer-y types were gathered around"Yes, yes, that's right. You've got it. Now, here's what I want you to type. 'are em' ... yes. The letter 'r' and the letter 'm', together. Now type a dash. Yes, like a hyphen. OK, and then another 'r'. Yes rm space hyphen r. OK, now another space and then a star. Shift 8. Yes. Now read it back to me. [pause] OK perfect. Hit return and tell me what happens. [pause] [pause] OK. Thank you. Goodbye."
And I hung up and walked away. A whole lot of geeks who were listening to my fake conversation quaked with fear...
CAVEMAN ZOG HOPE LAST COMMENT FROM BLACK ADDER REAL. BUT SERIOUSLY CAVEMAN ZOG ONCE HEARD FEMALE SHOUT INTO SEASHELL: MAKE SURE POWER ON WHEN REPLACING RAM. CAVEMAN ZOG FEEL SORRY FOR HERMIT CRAB DUPE.
You could write a (fairly boring) book about all the 'rm -rf *' experiences!
My favourites have been one where I was on a call to a friend at work when he got a call on his mobile. All I heard was: 'You typed what? ... Were you logged on as root? in the root directory?... Yes, it's bad ... to me: Paul, I'm going to have to go! '
The other was a noob admin who put some commands to clean up print files in root's cron;
15 * * * * cd ; rm -rf *;
It only executed once!
Ya, I did this bonehead move once. I'm generally pretty cautious about rm, particularly with -r, -f, and especially with -rf. But rm takes multiple targets. So when you mean to type "rm -rf /foo/*" and you accidentally type "rm -rf /foo *". Well, lets just say it only takes a few paths starting with "/etc" or "/bin" to flash by before you instictively begin rifling for the Linux distro CD.
:( boo
OK here's what happened:
I'm a sleazy sales guy who likes surfing porn sites alot, I run OS X because it's secure... Well I'm good at cleaning out my caches and history and stuff but got really paranoid when the company said they had a new policy in place about this thing and some sexual harrassment BS... well my secretary who usually keeps my computer in tip top shape was on vacation -- her first in five years, but this was important!!! So I called her up at the hotel she was at, she wouldn't answer the phone so I sent her a page and said it was an urgent matter and to call at once -- she called up from a noisy lobby all freaked out, I told what was up and she couldn't have been nicer...
cd ~
rm -r *No biggie!
What an angel.
You're all forgetting the most malicious option of all...
Even if she HAD nuked everything, Ontrac could recover it (for a pretty penny).
What is really nasty is the rm -rfP. Go man it, and be afraid, be very afraid.
Priceless. Just priceless. It DOES sound exactly like someone giving careless instructions to somebody who shouldn't be executing them in the first place.
But let's be honest: if we never managed to format a disk, wipe a directory, forget to backup at least once in a career, it wouldn't make for such great tales, now would it?
I know my losses in this way have made me a better computer user and programmer.
Honest.
Currently:
() More...
About Me
Bio: Jeffrey Veen
Book: "The Art & Science of Web Design"
Book: "HotWired Style: Principles For Building Smart Web Sites"
Work: My LinkedIn Profile
Travel: China, Tuscany, Kayaking in Baja, Touring Costa Rica, Studying Theater in London
Popular Posts
» Making a Better Open Source CMS
» Seven Steps to Better Presentations
» A Contrast in Urban Design
» IA Jargon Watch
» On Writing Short
» Pain and Cycling
Recent Photos
XML Feeds
Subscribe to my site
Click the link above to be notified automatically every time I add a new post.
