TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The classic Unix horror story

80 pointsby naralmost 15 years ago

19 comments

randrewsalmost 15 years ago
I've never actually been bitten by rm (or done anything remotely this badass) but in college I did have a bad Unix moment:<p>Late at night, I was tarring up a finished project right before emailing it to my professor. I ran:<p><pre><code> tar -cvf *.cpp *.h something.tar </code></pre> instead of:<p><pre><code> tar -cvf something.tar *.cpp *.h </code></pre> It happily wrote most of my project into a tar file on top of the first source file, then complained that something.tar didn't exist. I overwrote "array.cpp" or something like that, and had to rewrite it (this was before I used source control for anything, and a large part of why I learned to use source control).<p>Writing this comment, I had to look up the order of the parameters to tar; I still can't remember. Stupid tar.
评论 #1621733 未加载
评论 #1621832 未加载
评论 #1622689 未加载
评论 #1622112 未加载
swolchokalmost 15 years ago
Is there a "social news sites classics" directory yet? I would love to see reposts of oldies no longer justified due to a good directory of these things, prominently linked.<p>Pretty please do not create such a directory in this comments thread.
评论 #1621818 未加载
jffalmost 15 years ago
Man, how many times is this story going to be submitted?
评论 #1621675 未加载
phugoidalmost 15 years ago
I might have misunderstood the story, but if this happened to me today on my gear I would simply turn it all off, connect that half-erased hard disk to another machine, mount it, and pull all the data off. And only after a lot of googling to see if some of the lost files could be "undeleted".<p>Salvaging the disk by recreating a minimalist system on it is heroic and hacky, but was that the only way?
评论 #1622816 未加载
julius_geezeralmost 15 years ago
Back in the dinosaur days I worked with DG minis running AOS/VS, a Multics descendant. From time to time an operator would run the equivalent of cd /; rm -rf, halting everything. The neat thing about the delete command was that would zap the PMGR, peripherals manager, quite early on; unable to communicate with the disks, the delete would fail. Generally one could then locate an older version of :PMGR to rename, then recover. Failing that, one could boot off a "systape" and recover.<p>Not as hard-core as the recovery through emacs, but greatly welcome under stress.
h0h0h0almost 15 years ago
I don't agree with the following comment:<p>"Great programmers spend very little of their time writing code – at least code that ends up in the final product. Programmers who spend much of their time writing code are too lazy, too ignorant, or too arrogant to find existing solutions to old problems. "<p>I mean so... who's writing the code then? Who's writing the original code? I would call a clever programmer a great programmer. Just clever. and sometimes clever can get you into trouble. But just sometimes :)
评论 #1622252 未加载
watmoughalmost 15 years ago
My terrible UNIX, or really SunOS/Solaris moments have been:<p><pre><code> o typing 'halt' into the wrong xterm, shutting down well planners o and likely on the same network, jacking up the NIS+ on Solaris </code></pre> It's been a constant itch that I never did manage to understand what I was doing wrong, such that NIS+ wouldn't restart correctly.
评论 #1621794 未加载
评论 #1622125 未加载
hernan7almost 15 years ago
I still remember my "rm -fr /" episode after almost 20 years. It was slightly different, something related to chmod'ing some files under /etc on an AIX server:<p><pre><code> $ cd /etc $ chmod 600 some_file * # instead of some_file.* </code></pre> oops... Thank God for boot diskettes.
评论 #1621338 未加载
xyzzyzalmost 15 years ago
Oh, how many of us (including myself) experienced such things, and yet we're unwilling to admit that there is something fundamentally wrong with tools that <i>just</i> do what we tell them to.
评论 #1622681 未加载
retroafromanalmost 15 years ago
I'd say this is a classic Unix success story, told in the context of an almost horror. It shows how a serious understanding of Unix-foo can save the day when someone makes a mistake.
gwalkeralmost 15 years ago
The Unix Haters' Handbook is worth looking up. I think it is out of print but the PDF is available for download.<p>My favourite from USENET is cleaning out <i>.o files after compiling C code but fat-fingering the SHIFT key and instead of typing<p>% rm -f \</i>.o<p>,typing<p>% rm -f *&#62;o<p>which gives you an empty directory and a zero length file called "o"<p>ah yes....
X-Istencealmost 15 years ago
While part of a team of students at a hacking competition I was VNC'ed into an owned 2003 server, I was trying to get to the network settings properties menu, when my VNC session lagged and I clicked at the same time that my mouse reached the Disable interface.<p>Yeah ... I didn't live that one down, lost my team some points.
评论 #1622838 未加载
pilifalmost 15 years ago
This reminds me of the faithful day when I finally stopped working as root all the time.<p>That happened right after typing<p><pre><code> cp backup.tar.gz /dev/sda </code></pre> That was fun. Also, back then I had no idea how easy it would have been to at least get the contents of that backup file back using dd
djacobsalmost 15 years ago
This makes Unix's orthogonality really clear. I'm fascinated the system was still able to run after taking that kind of a hit. Imagine what would happen to WIndows (immediately) if half the system (including key system binaries) were destroyed.
评论 #1622822 未加载
terra_talmost 15 years ago
One time I did something like<p>$ chown -R terra_t.terra_t /<p>on a production system. Fortunately I was able to recover the permissions of most of the system files from the rpm database, and do the rest by hand...
makmanalpalmost 15 years ago
My personal favourite is "rm -rf * .swp" instead of "rm -rf *.swp" or such.
flatulent1almost 15 years ago
An old story but still shocking.<p>One should be careful making such damage threats though, may end up with male appendage replacing rabbit foot on someones' keychain
yreadalmost 15 years ago
Thank god Windows has the stupid and annoying file locking!
评论 #1622052 未加载
mkramlichalmost 15 years ago
frequent automated offsite backups are your friend
评论 #1622140 未加载
评论 #1621561 未加载