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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

What is the difference between a terminal, a shell, a TTY and a console? (2012)

274 点作者 ent101超过 1 年前

15 条评论

alberth超过 1 年前
Reddit has the most concise answer<p><a href="https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;programming&#x2F;comments&#x2F;41u5hw&#x2F;comment&#x2F;cz5ejh6&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;programming&#x2F;comments&#x2F;41u5hw&#x2F;comment...</a><p>&gt; A terminal is a physical device with a keyboard and screen connected to a computer running various OS types. A tty is the Unix device name for a physical or virtual terminal connection. A shell is the Unix command interpreter. A console is a generic term for a primary i&#x2F;o device or interface. In unix terms the console is where the boot&#x2F;startup messages are sent to. After bootup the console effectively becomes a terminal.
评论 #38989310 未加载
khazhoux超过 1 年前
Classic Stack Overflow, willfully ignores the likely intent of the questioner, with pedantic answers which ignore the most common modern usages of the terms. Subtle condescension and authoritative declarations (“a console MUST be a piece of hardware”) which are actually incorrect in modern usage.<p>SO really does attract misanthropes.
评论 #38986542 未加载
评论 #38987173 未加载
评论 #38987613 未加载
评论 #38989372 未加载
评论 #38986711 未加载
评论 #39007471 未加载
评论 #38986511 未加载
评论 #38986522 未加载
bitwize超过 1 年前
A terminal is a device, typically with a screen and keyboard, used to remotely communicate with a computer. Pieces of software that serve this purpose are technically terminal <i>emulators</i>, but in 2024 we just call them terminals because people who use actual terminals, like a VT100 or even an X terminal, are few and far between. So when a Show HN comes along that says &quot;I made a new terminal! It&#x27;s written in Rust and does this or that&quot; they&#x27;re not talking about terminals in the traditional sense but pieces of software, a usage of the term I find... urticating.<p>A shell is a UI to the operating system, used for file management, launching programs, etc. Historically it referred to Unix terminology: the kernel was the bit of the OS that actually performed operations, and the shell was a user friendly wrapper around the kernel&#x27;s system-call interface. Usages drifted, however, and the shell became called upon to do other things, while the one-to-one mapping between shell commands and system calls drifted and was outsourced to external programs (cp, mv, rm, etc.) But the idea that the shell was your UI into system management persisted. Shells can be graphical; Explorer on Windows and Finder on macOS can be considered shells.<p>TTY stands for Teletype, an early form of terminal called a teletypewriter. Like a normal typewriter, it printed on paper rather than having a screen. For historical reasons, Unix systems have device nodes called &#x2F;dev&#x2F;ttyXX to represent terminal connections.<p>The console is the main user interface to the system. On old mainframes and minis, it was a dedicated terminal sitting in the room the computer was in and wired directly to it. Other terminals could be located in another room, building, or far away and might communicate with the computer via modem or other telecom link. Some administrative functions, such as installing the OS itself, could only be performed via the console. Today, a typical PC&#x27;s attached monitor(s), keyboard, and pointing device might be considered the console, and might be abstracted as such through e.g., &#x2F;dev&#x2F;console, or at a lower level, NetBSD&#x27;s wscons(4) kernel driver.
floren超过 1 年前
A terminal is a device for remotely accessing a computer. A TTY is a Teletype, a kind of printing terminal; it takes input one character at a time and outputs one character at a time. A shell is the program that reads what commands the user, sitting at his teletype, wants to invoke. A console is the set of toggle switches on the front of your computer you use to load the bootstrap.
wlamartin超过 1 年前
Recently I&#x27;ve been wondering if there is a &quot;build your own X&quot; for some of these concepts. For example, there is <a href="https:&#x2F;&#x2F;github.com&#x2F;xyproto&#x2F;vt100">https:&#x2F;&#x2F;github.com&#x2F;xyproto&#x2F;vt100</a> which seems relatively straightforward (though maybe not &quot;simple&quot;) to learn from but are there any resources that would actually teach this stuff?
ijhuygft776超过 1 年前
I can almost promise you that if those terms ever become mainstream, their meanings will be totally different then what they are today.
评论 #38987803 未加载
TacticalCoder超过 1 年前
Call me newschool or oldschool or whatever but...<p><pre><code> ... $ tty &#x2F;dev&#x2F;tty1 &lt;- that&#x27;s sorta a modern &quot;tty&quot; ... $ tty &#x2F;dev&#x2F;pts&#x2F;17 &lt;- that&#x27;s a pseudo-tty </code></pre> I like this one:<p><a href="https:&#x2F;&#x2F;www.baeldung.com&#x2F;linux&#x2F;pty-vs-tty" rel="nofollow">https:&#x2F;&#x2F;www.baeldung.com&#x2F;linux&#x2F;pty-vs-tty</a>
评论 #38987353 未加载
wruza超过 1 年前
Now what’s the difference between a process, a process group, a session, a session leader, a deamon and a background process? &#x2F;jk
est超过 1 年前
I might be wrong, terminal is a physical&#x2F;virtual device that output displays or input typing. A TTY&#x2F;PTY is a mechanism to translate wire protocol bytes (like parse ANSI escape codes). A shell distinguishes bash&#x2F;zsh&#x2F;csh. A console is stdin&#x2F;stdou&#x2F;stderr
jamapy超过 1 年前
I found this answer the question plus some additional background info.<p><a href="https:&#x2F;&#x2F;unixsheikh.com&#x2F;articles&#x2F;the-terminal-the-console-and-the-shell-what-are-they.html" rel="nofollow">https:&#x2F;&#x2F;unixsheikh.com&#x2F;articles&#x2F;the-terminal-the-console-and...</a>
ChrisArchitect超过 1 年前
(2010)
zeroCalories超过 1 年前
The definition for terminal and console seem switched for the first answer, and I don&#x27;t think it&#x27;s correct to say tty = terminal.
jibbit超过 1 年前
joe armstrong gave a talk where he recommends &#x27;4 ancient technologies worth learning&#x27;, or some such. one of them is bash, and another is shell (and emacs, and something else). given that it&#x27;s joe - i think he knows what he&#x27;s saying - but it makes no sense with respect to any of these explanations
评论 #38989259 未加载
dvh超过 1 年前
Is it possible to enable sixel support in console (here I mean in the Ctrl+alt+f1 to f6)?
abnry超过 1 年前
And then there are PTYs or psuedoterminals.