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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

To understand the command line...

156 点作者 jonathansizz超过 12 年前

8 条评论

smacktoward超过 12 年前
I liked this piece overall, but there's one part that annoyed me.<p><i>Something else that had long-lasting influence over software we still use today was the ADM-3A terminal. If you ever wondered why vi uses 'hjkl' as left,down,up,right - this is why.</i><p>You won't find anyone who believes more strongly than I do in the importance of understanding our history. But <i>understanding</i> history is different than making a <i>fetish</i> of it, and this explanation tiptoes pretty close to the latter. OK, vi uses hjkl because the ADM-3A terminal didn't have arrow keys. But every keyboard for decades now <i>has</i> had arrow keys. Given that, what's the value in pretending they do not?<p>This explanation basically boils down to "we do it that way because we've always done it that way," which is poor argumentation.<p><i>It's also a good illustration of the distinction between 'easy' and 'efficient' - the modern cursor key layout, with the 'up' in front of the 'down', is obvious, intuitive, and easy to master. No argument. But it's not the most efficient layout - it's not possible to keep all four fingers on the four navigation keys - you have to settle for three fingers and move them around. And if you're typing and suddenly need to move, you have to move completely away from where you're typing and switch to the cursors.</i><p><i>hjkl answers both issues - the four keys in a line make it possible to keep one finger on each and so move about as quickly as possible, without ever having to move from the text-entry part of the keyboard to any other. It's not as easy, not as obvious, but it's quicker and more efficient when you're used to it. Even on my modern keyboard, I go for hjkl far more than I reach for cursors.</i><p>Well sure you do, because <i>you have trained yourself to do that.</i> But how many people can say that? And what's the value in leaving everybody else out when you design your tools?<p>Anytime you talk about how UNIX-like systems have evolved, there's a danger of falling into the trap of hailing historical cruft as "misunderstood features." But at the end of the day, it's still just historical cruft. It's there, it won't kill anyone if it <i>stays</i> there, but it's not something awesome either. It's just an evolutionary dead-end; the male nipple of software design.
评论 #4597347 未加载
评论 #4597396 未加载
评论 #4597541 未加载
评论 #4597338 未加载
评论 #4597334 未加载
评论 #4600597 未加载
评论 #4599309 未加载
评论 #4599261 未加载
tmhedberg超过 12 年前
Pretty much any question about why things are done a particular way in Unix can be answered the same way: "for historical reasons".<p>I'm a full-time Linux user, so that's not intended as a dig against Unix, but merely an observation. Each of the traditional Unix utilities evolved from some earlier tool, and carries with it to this day both the quirks of its predecessors and many artifacts of the design constraints of the time. Some argue that this diminishes usability, and they may have a point. But I find that it gives Unix a certain charming character that I've grown quite fond of. I suspect this sentiment is fairly pervasive, and probably contributes substantially to Unix's resistance to change over time. Maybe it isn't the simplest thing to learn from scratch, but it's robust and highly dependable once you've learned it.
dreamdu5t超过 12 年前
This article assumes the reader already knows a lot about the CLI.<p>A much better introduction to the commandline is Neal Stephenson's "In the Beginning was the Command Line."<p>Read it here: <a href="http://www.cryptonomicon.com/beginning.html" rel="nofollow">http://www.cryptonomicon.com/beginning.html</a>
评论 #4597778 未加载
jff超过 12 年前
You should make it clear that while Thompson did allocate a week to the editor, he did not write vi--although one might think so, with that quote coming right in the middle of a block about vi.
pif超过 12 年前
&#62; This is bad, because it means that the difference between a master and a beginner is almost nothing.<p>Wonderful!<p>Special thanks for explaining the genesis of thos tools names.
ktf超过 12 年前
<i>So the "show me matching lines" functionality, which ed users made massive use of, could be summed up as "globally search for the regular expression and print it" - or, in ed format, g/regular expression/p. Or, to shorten it a bit more, g/re/p</i><p>Thanks, I've always wondered where "grep" came from! (But somehow have never gained the momentum necessary to look it up...)
评论 #4600036 未加载
dsego超过 12 年前
Nice article, for a better understating of Unix and its history I recommend the awesome UNIX-HATERS Handbook (<a href="http://m.simson.net/ugh.pdf" rel="nofollow">http://m.simson.net/ugh.pdf</a>).
loeschg超过 12 年前
Where's the spoiler alert? Psh. No need to watch LOTR now... :)