6 ms·
What is the difference between a terminal, a shell, a TTY and a console? (2012)
- khazhoux 3y agoClassic 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. SO really does attract misanthropes.
- corethree 3y agoA shell is where a turtle lives.
- deleted 3y ago[deleted]
- andirk 3y agoA console is what turtle's play video games on.
- nick222226 3y agotty is when the turtle is talking to you now instead of later
- quickthrower2 3y agoTortoise SVN and Tortoise Git like that joke
- HPsquared 3y agoSO is full of people going too narrow, HN is full of people going too broad.
- maegul 3y agoHa, yes. But in HN’s defence, I think HN is not willing and capable of correcting toward narrowness when needed than SO is the other way.
- blendergeek 3y agoFortunately the top answer doesn't suffer from that issue as far as I can tell. It is much longer and explains both the etymology of the terms and how they are used today.
- khazhoux 3y agoBut it misses the most obvious answer (and most likely where the question originated from): terminal, console, and shell often refer to the same thing. If one is following a tutorial and it says to “enter this command into your console”, they mean the same as type it in your terminal app or into your shell. The terms are indeed somewhat interchangeable, as a starting point at least for the clearest answer. Then we can dig into actual differences: the shell is actually an application that runs inside the terminal/console, and you can swap in your favorite shell app; on MacOS, the Console and Terminal apps look similar, but Terminal is what you should use normally, with Console more for debugging system outputs. And so on. Humor people with practical answers sometimes, for christsake, instead of these agonzing pendantic expositions. Side notes on pseudo-ttys, ioctl, virtual condoles, and control sequences when the OP posted an elementary question?? Yeah, we get it, professor: you are overburdened with information which you must share.
- basil-rash 3y agoThat was already included in the question, there’s no use repeating it in the answer.
- zzyzxd 3y agoWell, the OP already realized that they often refer to the same thing, and was just curious about the fundamental differences. > Side notes on pseudo-ttys, ioctl, virtual condoles, and control sequences when the OP posted an elementary question?? Yeah, we get it, professor: you are overburdened with information which you must share. I don't know if it's elementary but I knew ioctl long before I learned that "tty" stands for teletypewriter. (Top answer: "tty is a strange abbreviation". Me: ha, sure, because if you are curious enough to look up for the abbreviation, the long form itself is pretty much self explanatory). The answer doesn't feel condescending to me. Similarly, my professor talked to me like that when I was a student and I didn't find that condescending -- it's just a person who knows a particular topic better than me trying to make a gentle introduction. If someone not only answered my question, but also voluntarily spent another hour telling me all the background stories, I would have nothing but gratitude. Sure, some of those people may not be the nicest person in the world. if you just need a quick answer and be done, you can ask ChatGPT to summarize it.
- charonn0 3y agoI don't see the problem you do. SO is a Q&A based knowledge base. Questions are supposed to be somewhat open-ended prompts that inspire experts to write detailed and informative responses. The OP seems to be an excellent example this.
- matheusmoreira 3y ago> Questions are supposed to be somewhat open-ended prompts that inspire experts to write detailed and informative responses. > open ended I recently tried asking a question like that. Easy but effective optimization techniques for programming languages. Hell I included an answer myself and was going to add more. The result wasn't pretty. While I was typing up a second answer, the question was downvoted, closed, someone welcomed me to the site and then deleted the comment, the answer I included with the post was downvoted not for being wrong but for "enabling" a bad question, I got told to get out and go blog about it instead and then a few days later the entire thing was deleted like worthless spam.
- dr_kiszonka 3y agoYikes.
- realusername 3y agoI had the same experience myself, Stackoverflow isn't going down because of AI which they use as a scapegoat but because the community became more and more toxic to the point of no return and there's no blaming others for that.
- Izkata 3y ago> techniques Plural? Obviously that wouldn't be accepted. It should be something that can have a single best answer. Open-ended that allows an expert to expand and explain doesn't mean free-for-all.
- matheusmoreira 3y agoYes, plural. It was a question similar to this one: https://stackoverflow.com/q/500607 https://stackoverflow.com/q/500607 Some of the greatest questions on StackOverflow are open ended like that. I've gotten people to reverse closures before. They closed a Q&A pair I made on the finance site where I explained how I did something specific with the ledger software. Closed, then reopened with a positive score. Not this time, I guess. I linked that question as an example but it didn't really convince anyone. I was frustrated but eventually I just accepted it, left it alone and went away for a few days. Came back later to find they had just deleted the question along with the one answer I managed to write. That made me feel like shit. Certainly didn't expect that, especially not from a stack exchange site that's still in beta and thus in need of content.
- pompino 3y ago>willfully ignores the likely intent of the questioner, >Subtle condescension and authoritative declarations Well maybe we shouldn't ignore the intent of the answer ;) >SO really does attract misanthropes. Wow, I think you're reading way to much into this.
- matheusmoreira 3y agoI don't know, it wasn't always like this. Stack Exchange communities are very different now, I don't think they're the same sites I used to participate in. Coming back to them now resulted in some very negative experiences, people treated me like some worthless spammer whose posts deserve to not only be closed but also literally deleted. It wasn't always like that.
- bazoom42 3y agoYour comment is entitely unhelpful though. It is everything you accuse the SO answer of being.
- mock-possum 3y agoYeah the irony of using a browser to post “a console MUST be a piece of hardware” when hitting F12 easily belies the statement is just mind boggling.
- TacticalCoder 3y agoCall me newschool or oldschool or whatever but... ... $ tty /dev/tty1 <- that's sorta a modern "tty" ... $ tty /dev/pts/17 <- that's a pseudo-tty I like this one: https://www.baeldung.com/linux/pty-vs-tty https://www.baeldung.com/linux/pty-vs-tty
- abnry 3y agoI guess my understanding is that a tty must involve a device driver for an actual piece of hardware. A pty is all software, implemented as a feature of the kernel any application can ask for.
- krackers 3y agoBut on modern linux even the tty is a "virtual tty". Is the device driver part implicit in the kernel (which dumps out the contents to frame buffer)?
- ChrisArchitect 3y ago(2010)
- alberth 3y agoReddit has the most concise answer https://www.reddit.com/r/programming/comments/41u5hw/comment/cz5ejh6/ https://www.reddit.com/r/programming/comments/41u5hw/comment... > 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/o device or interface. In unix terms the console is where the boot/startup messages are sent to. After bootup the console effectively becomes a terminal.
- benj111 3y agoIsh. A tty can refer to a device name, or a physical terminal. A terminal can refer to a physical or virtual terminal. A console could also refer to a physical device, although I'm not aware of it being used in this context. The problem is that computing is all metaphors. Metaphors leak and once we lose one meaning (enough) we stop clarifying to differentiate. We don't generally need to differentiate between a physical terminal and a virtual terminal, so we don't.
- cobbaut 3y ago> A console could also refer to a physical device, although I'm not aware of it being used in this context. I thought that the console is used for any device (or application) that listens to /dev/console (at least on Linux).
- zeroCalories 3y agoThe definition for terminal and console seem switched for the first answer, and I don't think it's correct to say tty = terminal.
- floren 3y agoA 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.
- abnry 3y agoAnd then there are PTYs or psuedoterminals.
- bitwize 3y agoA 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 emulators, 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 "I made a new terminal! It's written in Rust and does this or that" they're not talking about terminals in the traditional sense but pieces of software, a usage of the term I find... urticating. 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'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. 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 /dev/ttyXX to represent terminal connections. 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's attached monitor(s), keyboard, and pointing device might be considered the console, and might be abstracted as such through e.g., /dev/console, or at a lower level, NetBSD's wscons(4) kernel driver.
- ijhuygft776 3y agoI can almost promise you that if those terms ever become mainstream, their meanings will be totally different then what they are today.
- ryandv 3y agoPrecision of language, definitions, and meaning seems to dilute as words gain more widespread usage. Eventually the word becomes a hollow symbol meaning multiple different things to different people, with the intersection between those meanings growing ever narrower.
- ijhuygft776 3y agothats probably true, but sometimes, their meaning can become almost the opposite... take hacker for example... I think that it started as something good.
- neuromanser 3y ago> take hacker for example... I think that it started as something good. … he wrote on a site called Hacker News that is not focussed on unauthorized computer access :)
- aspenmayer 3y ago> take hacker for example... I think that it started as something good. You just reminded me of one of the earlier uses of “hacker” in popular culture that I’m aware of - They Live (1988) - one of the vagrant guys in the homeless encampment referred to the interference upon the analog TV broadcast as being the work of a hacker: https://www.youtube.com/watch?v=1V-4JHT2q3w https://www.youtube.com/watch?v=1V-4JHT2q3w This fictional hack may be inspired by actual events from a year earlier: https://en.wikipedia.org/wiki/Max_Headroom_signal_hijacking https://en.wikipedia.org/wiki/Max_Headroom_signal_hijacking I remember one of the kids in the film Jurassic Park referring to themselves as a hacker, but this time in a positive light. Not sure if that line was in the original book, or if that was an addition for the movie.
- wruza 3y agoNow what’s the difference between a process, a process group, a session, a session leader, a deamon and a background process? /jk
- KingLancelot 3y ago[dead]
- wlamartin 3y agoRecently I've been wondering if there is a "build your own X" for some of these concepts. For example, there is https://github.com/xyproto/vt100 https://github.com/xyproto/vt100 which seems relatively straightforward (though maybe not "simple") to learn from but are there any resources that would actually teach this stuff?
- jibbit 3y agojoe armstrong gave a talk where he recommends '4 ancient technologies worth learning', or some such. one of them is bash, and another is shell (and emacs, and something else). given that it's joe - i think he knows what he's saying - but it makes no sense with respect to any of these explanations
- pprotas 3y agobash is a shell, it's even in the name: 'Bourne Again Shell'. But bash is also a programming language. I couldn't find the talk that you're referring to, but Joe might have been referring to 1. 'using the shell' - as in, interacting with your OS through text, learning POSIX commands (which you could be executing with bash) and the mindset you need for shell usage 2. 'using bash' - as in, using bash as a scripting language also vim > emacs ;)
- jibbit 3y agofound it.. it's just a slide in "Joe Armstrong - Keynote: The Forgotten Ideas in Computer Science - Code BEAM SF 2018"
- neuromanser 3y agoWhat's the difference between 1. and 2. besides interactivity / REPL? "Using the shell" means inputting the shell language into the interpreter; "using the shell as a scripting language" includes POSIX commands, and the mindset needed is the same in both use cases, no? The beauty of shell is in that exact crossover.
- dvh 3y agoIs it possible to enable sixel support in console (here I mean in the Ctrl+alt+f1 to f6)?
- est 3y agoI might be wrong, terminal is a physical/virtual device that output displays or input typing. A TTY/PTY is a mechanism to translate wire protocol bytes (like parse ANSI escape codes). A shell distinguishes bash/zsh/csh. A console is stdin/stdou/stderr
- jamapy 3y agoI found this answer the question plus some additional background info. https://unixsheikh.com/articles/the-terminal-the-console-and-the-shell-what-are-they.html https://unixsheikh.com/articles/the-terminal-the-console-and...