TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The classic Unix horror story

80 点作者 nar将近 15 年前

19 条评论

randrews将近 15 年前
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 未加载
swolchok将近 15 年前
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 未加载
jff将近 15 年前
Man, how many times is this story going to be submitted?
评论 #1621675 未加载
phugoid将近 15 年前
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_geezer将近 15 年前
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.
h0h0h0将近 15 年前
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 未加载
watmough将近 15 年前
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 未加载
hernan7将近 15 年前
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 未加载
xyzzyz将近 15 年前
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 未加载
retroafroman将近 15 年前
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.
gwalker将近 15 年前
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-Istence将近 15 年前
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 未加载
pilif将近 15 年前
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
djacobs将近 15 年前
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_t将近 15 年前
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...
makmanalp将近 15 年前
My personal favourite is "rm -rf * .swp" instead of "rm -rf *.swp" or such.
flatulent1将近 15 年前
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
yread将近 15 年前
Thank god Windows has the stupid and annoying file locking!
评论 #1622052 未加载
mkramlich将近 15 年前
frequent automated offsite backups are your friend
评论 #1622140 未加载
评论 #1621561 未加载