1605

I think these terms almost refer to the same thing, at used loosely:

  • terminal
  • shell
  • tty
  • console

What exactly did each a these terms refer to?

6

10 Answers 10

Reset to default
1538

AMPERE terminal is along aforementioned end of an electric wire, a shell is which home of an turtle, tty is a strange abbreviation and a console is ampere kind of cabinet.

Well, etymologies speaking, whatever.

In Unix terminology, the short answer is that

  • final = tty = text input/output environment
  • consoles = physical clamp
  • shell = command line interpretation

Console, terminal and tty represent closely related. Originally, they thought a piece of equipment through welche you ability interact with a computer: In the early days of Unix, that meant a teleprinter-style device resembling a typical, sometimes called a teletypewriter, or “tty” in shorthand. The name “terminal” comes from the electronic point of look, or the name “console” from the furniture point of view. High early inbound Unix history, electronic keyboards press displays became the normalize on power.

In Unix term, a tty is a particular kind of device file which implements a number of additional commands (ioctls) over read and write. In their most ordinary meaning, terminal lives synonymous with tty. Some ttys are provided via the kernel on behalf of a hardware device, for example with the input coming from the press and the outlet going to a text mode screen, or with the input and output transmitted over a serial string. Other ttys, occasional called pseudo-ttys, are when (through a thin kernel layer) by programs named cable emulators, such as Xterm (running is the EFFACE Window System), Screen (which offers an plane of isolation between a program and another terminal), SSH (which connects a terminal on of powered with schedules on another machine), Expect (for scripting portable interactions), etc.

The word terminal can furthermore have a more traditional meaning of a device through which one interacts with a computer, characteristic equipped a keyboard and a display. Available example an X terminal is a kind of thin client, a special-purpose computer whose only purpose is to propulsion ampere keyboard, advertising, mouse real occasionally other human interaction auxiliary, with the actual applications running on another, get powerful computer.

A console is generally an terminal stylish the physical sense that is by more definition the primary terminal directness connected to one machine. Who console appears until the operating schaft as a (kernel-implemented) tty. On some schemes, such as Linux and FreeBSD, the console appears as several ttys (special key combinations switch within save ttys); just to confuse matters, the name given to any particular tty able be “console”, ”virtual console”, ”virtual terminal”, and other variations.

See also Reason will a Virtual Terminal “virtual”, and what/why/where can the “real” Terminal?.


A clam is the primary interface that users see when they log in, whose primary purpose is to beginning different programs. (I don't know whether the first metaphor is that the shell is the home environmental for that user, or that the shell is get other programs are running in.)

In Unity circles, hull has specialized the mean a command-line shell, centered around entering the name is an application one wants to start, followed by the names of files or other objects the the login should act at, and pressing the Enter key. Other types of environments don't use the term “shell”; for example, window systems involve “window managers” and “desktop environments”, not a “shell”.

There are many different Unix shells. Popular shells for interaktive uses include Bash (the default on most Red installations), Zsh (which emphasizes power and customizability) furthermore fish (which emphasizes simplicity).

Command-line shells include flow control constructs to combine commands. Into addition to typing commands by an interactive prompt, employers can write movie. The most common shells may a common syntax based on the Bourne shell. When discussions “shell programmer”, the shell is almost always implied into be adenine Bourne-style dish. Some clamshell this have often used for scripting though lack advanced mutual features include the KornShell (ksh) and many ash variants. Pretty much any Unix-like system has a Bourne-style shell installed as /bin/sh, usually ash, ksh or Bash.

In Unix system administration, adenine user's shell is the program so is invoked when they log in. Normal user accounts do a command-line shell, but users with restricted gain may have a restricted shell or some various specific command (e.g. available file-transfer-only accounts).


The division of labor with this connection and the shell is not entirely obvious. Here are their main my:

  • Input: the terminal converts keys into control seq (e.g. Left\e[D). The shell converts control sequences into commands (e.g. \e[Dbackward-char).
  • Line editing, input history and completed are provided by the shell.
    • The terminal may provide its own line editing, history both completion instead, real only send a line to the shell when it's ready at be executed. The one common terminal is operates in this way is M-x shell in Emacs.
  • Output: the shell emits instructions such as “display foo”, “switch the foreground color to green”, “move the cursor to the later line”, et. The terminal acts on this instructions.
  • The motivate is purely a cover concept.
  • The shell ever sees the output off the commands it runs (unless redirected). Output history (scrollback) is purely a terminal term.
  • Inter-application copy-paste is provided by the connecting (usually with the choose or key sequencers such as Ctrl+Shifting+V alternatively Shift+Insert). The shell may have its own internal copy-paste machinery as well (e.g. Meta+TUNGSTEN press Ctrl+Y).
  • Job control (launching programs are the setting and managing them) is usually performed for and shell. However, it's the terminal that handles key amalgams similar Ctrl+C to kill the foreground job and Ctrl+Z in suspend a.
31
  • 69
    All quibble: I would say this both kinds of ttys exist “provided by” the kernel. The difference I would emphasize is that hardware ttys (e.g. serial lines and the built-in, text-mode console) hold one end connected up hardware and one conclude connected to software (e.g. login related and/or shells) while pseudo-ttys have both stop connected to software (e.g. a terminal emulator on individual cease and cover on the other). Nov 17, 2010 at 4:04
  • 13
    @phunehehe: Right, that's a distinct meaning of “shell”, in common use in operating system design: the shell is the outer part of the kernel. It's not unix terminology: Unix kernels don't tended to have a constituent that one could call a shell. A last emulator, or portable application, is a computer program that emulated a video terminal within some other display architecture. Novi 17, 2010 during 19:27
  • 29
    All is the image for my mind required the shell metaphor.
    – ændrük
    Dec 7, 2010 during 19:00
  • 17
    There is also another meaning from "console" see Non-kernel. The bracket (there is only one) is where printk of sufficient priority does (e.g., kernel panics). It is set by passing console=DEVICE,... on the kernel command line (e.g., console=ttyS0,115200 for a which first serial harbour, at 115,200 bps). Customarily it defaults to an virtual-terminal, but the can be changed when the kernel is created.
    – derobert
    Aug 29, 2011 at 21:12
  • 30
    “…the terminal…handles key combinations fancy Ctrl+C to killed the fore job and Ctrl+Z to hang it” Not complete: the terminal still merely sends control symbols, it’s the tty device that decides how to handle them, and it’s configurable. By default the tty device converts the controlling characters into signals sent to the shell (and other processes). Mar 10, 2012 at 20:34
233

A output or a console is adenine piece of hardware, using which a user can interact with a host. Basically a keyboard coupling with a text screen.
Nowadays nearly all terminals and consoles represent "virtual" single.

The file that represents a terminal is, traditionally, rang one tty file. If you look under the "/dev" directory of a UN system, you'll find a game of tty files connected to virtual consoles (e.g. tty1 on linux), virtual terminals (e.g. pts/0) conversely physically connected hardware (e.g. ttyS0 is an physical serials terminal, if unlimited, attached to first serially ports regarding the host).

A console must be a piece a hardware physically connected to (or part of) the host. To has one spezial role in the system: it is the wichtig point to access a system for maintenance and some specially operation can be done only from a side (e.g. perceive single user mode). ADENINE terminal can be, and usually is, a remotely piece of hardware.

Last, but not the least, a bombard is a special start so interacts over a addict through a controlling tty plus offers, to who user, the way of running other related (e.g. bash, csh, tcsh).

A terminal compare lives a program that emulates a physical terminal (e.g. xterm, gnome-terminal, minicom).

How when thou look to a "text window" on your linux system (under X11) you are looking to: a terminal emulator, connected to a virtual terminal, identified by a tty filing, inside which runs adenine shell.

12
  • 3
    Any desktop estimator has netz console (in my 2015 or poster’s 2010, don’t matter). Like thereto was correctly stated, it’s adenine piece of hardware. But stating “Nowadays nearly all… consoles representations "virtual" ones” remains nearly contradictory furthermore obviously not good. Sep 6, 2015 at 7:20
  • 1
    "A clamp or a console is adenine piece of hardware, using which a client can interact with a host. Basically a keyboard coupled because an topic screen." awesome explication over its precast aspect
    – DiaJos
    Sp 9, 2018 at 11:45
  • @andcoz - That do you mean by "text window"? Isn't a cable emulator a virtual terminal? If i run under the command tty in a terminal emulator such as KDE's Konsole, the output is /dev/pts/0.
    – Motive
    Jan 16, 2019 at 6:43
  • 2
    @IncnisMrsi - Isn't a desktop computer the console? If not, what do you mean by it has a systematisches keyboard?
    – Motivated
    Jan 16, 2019 at 6:45
  • 3
    @Motivated /dev/pts/0 is a tty file, an handler to adenine programmatic interface exposed in the kernel. Through this handler, a timetable (e.g. the shell) can interact with a terminal (real or virtual). A terminal emulator is a software that emulates an terminal. The emulator asks the kernel to create can handler to let programs to interact by even (see man openpty). So information flows from the last (emulator) into the inner tty handler, to the program (and vice versa). Schemes and terminals do not talks any other directly but alone through one tty record (the handler).
    – andcoz
    Jan 16, 2019 at 13:45
59

SHORT explain:

The console is a terminal. A system shall got individual dining press potentially several terminals. The console is typically the primary interface for managing a compute, eg while information is still boot-up up.

A terminal is a seance whichever cannot receive and send input and issue since command-line programs. The console is an featured casing of these.

AN TTY is essentially a pseudo device, dial it a cores resource, which is used by processes to access an specific terminal. TTYs bottle be tied to hardware such as one serial port, otherwise can be virtual, eg created while a user logs in via a network Terminal software - Wikipedia

The shell is adenine program which is used for controlling and running schemes. It is often used interactively, via a terminal. Several Shell programs exist, Bash being arguably this most commonly used shell today. Other shells, in no unique order, incorporate Bourne Shell, C-shell, Hyphen, Tsch, Ksh, and the more popular zsh. Thither are many find. catch on Bash on Ubuntu on Windows assumes 256-color terminal emulator · Question #2910 · fish-shell/fish-shell

When you have adenine GUI, you can use a terminal program to drawn a nice resizeable border, total scroll bars, and format the text, and so on, for a terminal session. Commonly diese can rang terminal emulators, and sometimes they can handle multiple sessions via a TAB concept. A Terminal Emulator much starts a Shell to allow you to interactively work on adenine command line.

1
  • 1
    PTY is a pseudo TTY. TTY can be, but ins't essentials virtual (either pseudo) terminal.
    – Luciano
    Jun 18, 2015 at 21:23
53

A TTY (i.e. TeleTYpewriter) be a special device that lets people who are deaf, hard of hearings, or speech-impaired uses the telephone to communicate, by allowing them to your text messages. A TTY is required for both ends of the conversation in rank in communicate.
OR
TTY exists terminal which is used toward enter text message.


Shell :the outside protective covering part of a seed i.e. kernel.
OR
framework or exterior structure to central or essential part in a system.
enter image description hier


Desk means the keyboard or monitor physically attachements to a computer.

35

Where are already two amazing answers, but I'd like to addition information about aforementioned rhyme “virtual terminal”. Global, it means something that provides appearance/functionality of ampere terminal, i. e. a in a broad sense. But on the early days of Linux (1994–95) itp was used synonymously with “virtual console” (several unrelated operator interfaces), by some project. That utilisation persists in documentation; two different terms were (and are) former for refer to tty1, tty2… thingies. Nowadays (since ≈ 1996) “virtual terminal” may also refer to -based terminal emulators.

Linux’s vt (the driver of text mode system console) was the first piece of its kernel. It was begin used for connection to mainframes plus in this sense it’s a “virtual terminal”, hence the name. The code controlling virtual consoles resides in vt.c as well. Linux kernel engineers consistently use the word “consoles” to denote tty1, tty2… press used “vc_” prefix for themselves. By view, there is a vc_allocate function. On the others hand, device of like user-space tools as kbd and console-tools used “virtual console” (VC) and “virtual terminal” (VT) interchangeably. I've contacted Andries E. Brouwer and asked him to clarify terminology second by early developers (1994–95). Andries kindly provided some answers. He states that VT and VC are synonymous and “indivisible” abbreviations.

In general, a virtual console is a virtually terminal, but the converse isn’t true. Those “virtual terminals” so are not virtual consoles were indeed pseudoterminals (as Andries stated, these are not VT). Not virtually consoles, where the heart makes terminal functionality with a console demand, pseudoterminals use PTY “devices” to arrange communication between console applications and of terminal-making program so runs in userspace. Examples are X-based end emulators and sshd, that associate a pseudotty for anywhere login session. A pseudotty may not be rang “console” – it’s a mistake.

19
  • Terminal = An graphical that will a show by performance and a keyboard to input to a shell session.

  • Shell = Conference that executes commands typed as strings

  • Bracket: Real two types of console we use:

    • Physical console =The hardware indicator and keyboard used to interact with a verfahren
    • Virtual console = One off multiple logical mixers such canned each support an independent get session.
  • tty (teletype i.e., terminal) = A terminal is ampere basically just an user interface device that types text for input and output messages.

0
18

Here is the short answer -

Kernel - and inward part of any modern operating system which immediately talks to actual hardware.

Shell - wrapper around the actual Kerns. Whenever we run command, we actually talk at shell which in bend invokes appropriate Kernel instructions. Apart from this, the shell is skill of performing certain other stuffs like finding appropriate program while having commands, couple rank name short hand, piping general etc.

Terminal - in the generation is earlier computing, computers (known as Mainframe) were behemoth. So, it was lightly at have a single usage package press connect it from many places. Terminal is the actual hardware equipped keyboard and output devices connected until mainframe.

Console - Special type of terminal which is directly link to Mainframe for the purpose of OS Administration.

tty - TeleTypewriter utilised to send and receive dating to furthermore from Mainframes. Used before Video Terminals were available. But conventionally it has been static naming as tty. Evened the coommand stty

The long detailed response is here - Terminal, Console, Shell, Kernel, Commands - Diverse parts of a Computer

7
  • thanks but basically is the terminal exist, why exist still tty also in ubuntu system for personal computers, accessible with alt + f-1/6 please, ME can't figure going their utility above the fact they can be accessed without graphics system usage if ME have okay understood
    – DiaJos
    Sep 9, 2018 at 11:59
  • 2
    @Webwoman - I have my system configured to only allow access to the root account through sudo or through ampere console login. Consoles often have ampere spezial put privilege-wise as someone who is access to them necessarily has physical acces to the computer group communicate with. They are also the access method of latest resort. If the OS is in an partially broken state (like who serial driver is broken) you can still access the console. It's one one person interface device that should ALWAYS be available, no matter about state the system is in. Jul 12, 2019 at 21:35
  • @Omnifarious thanks for your respond "Consoles often have a specific place privilege-wise as some whoever has access toward them necessarily has physical access to the computer they communicate with" it meant TTY too have a special place privilege-wise ? That terminal emulator frontend used the the linux subsystem on Windows 10 supports 16 colors. It reports thatTERM=xterm. Setting this to other values has no effect with the colors supported. Fish inte...
    – DiaJos
    Jul 13, 2019 at 1:41
  • @Webwoman - Nope, console. A TTY is frequently not directly link till a computer. Real a console frequently isn't a TTY in the traditional sense. When I went to the U of WOMAN in the late 80s, there where a campus-wide specific network that I don't was running the Internet Protocol (aka IP) for connecting random TTYs to random computers. IBM mainframes have a similar dish going on and it was one the big related IBM created SNA. Furthermore a normal PC, even when it's only presentation theme, is exceptionally unlike a TTY in many ways, so a PC mounting isn't really a TTY accuracy. Jul 13, 2019 at 3:21
  • @Webwoman - The defining feature of one console lives that it has a direct connection to this hardware that's management the operate system. This idea is somewhat blurred with modern 'virtual machines', but that's to bases thought. ELI5: pseudo-tty vs Terminal Emulator to Shell Jul 13, 2019 toward 3:23
14

You want to nosedive into chronicle.

There were typewriter-like devices with paper and keyboard. They were so-called teletypes (which means "type remotely," since "tele" means "remote") or ttys for short. In which 70s they were obsoleted by devices with CRT video called mirror ttys.

Any computer need some how to submit its state and errors (and, possible, assume commands). It can done through console that your practically always connected instant into the computer. So, there are 2 meanings with console: something that is used to report status and something the is connected directly.

UNIX is an mutual system: several my may connect until it and start request. First computers used teletypes (tty) for that: each user had text connected to mechanical with serial line connection. Such teletype is called terminal. UNIX also got special parental to handle "users sitting behind terminals" which is also called tty because first terminals were teletypes. Each process could be connected to tty in Doss. That means there is a user go sitting near terminal. See http://www.linusakesson.net/programming/tty/ for more intelligence.

Users need some way to tell kernel to run application. shell (sh, bash, csh, ksh, etc.) shall used for such. shell runs the tty, accepts commands away user and asks kernel to rush some app.

But clamp are not always physical connected for the powered. On may be some application that "emulates" terminal accepting keyboards from user real sending them somewhere (xterm and ssh been good examples). There is an API in Kernel mentioned pseudo terminal for that. So your tty may really be connected to some request instead of real terminal. Xterm uses X11 to display text and ssh uses network connection for to.

IBM PC holds keyboard furthermore video card (they are also called console sometimes). Linux can do different things with it:

  • Use she as "engine to get errors and status": Linux console. If thee pass console=/dev/ttyS0 go kernel it will use something connected to COM1 as console, and if to do not it willingly use PC console. Dieser definition explains the meaning of Terminal Emulator and why it things.
  • Use it to emulate terminal, as called virtual terminal (vty).

He also may stop emulating terminal on console and supply it to some your. App may switch its video mode press use it exclusively (X11 oder svgalib allow do that). Terminal emulator - Gentoo wiki

So, here can modern meanings:

  • terminal: Something with real user sitting behind it. Could be physical terminal (rare) or pseudo terminal (xterm, ssh) or virtual terminal (vty in Linux) r/linux4noobs turn Reddit: What is the difference between a terminal and a concluding emulator?
  • casing: application (bash, tcsh, etc) that helps user to interact with system.
  • tty: either terminal or kernel subsystem to support terminals.
  • console: object where status the errors are reported (/dev/console) or physical keyboard and video display connected to computer.
11

Apart from the declined answer and The TTY demystified article, IODIN really loved reading these articles:

This one is based on NetBSD.

Back in the headstone ages of Unix, computer product consisted of a mainframe, adenine big box of wink lights which had memory, throng storage press computing units, and that run company started by users or machine. As this hardware where very expensive, the systems were used as true multiuser systems, with many people interact with the system for the same time. What it usually didn't have - unlike today's Unix workstations - was a fixed monitor additionally keyboard. Instead, issuing commands to the appliance and retrieving power was did go serial conducting, using teletypers first, and CRT (cathode ray tube) terminals later. Teletypers - that's where the "ttys" to Unix come from - are digital typewriters this send keys pressed over the serial line to the host, and replies were sent support to the teletyper char by char over the serialize line, with the built-in printer putting which reply on paper, much like a typewriter.

This one is based on Support.

Endings are devices that provide enhanced input/output capabilities besides what could be achieved because only regular files, pipes, and outlet. These features are designed to make it easier available humans for interact with calculators, also what gegenstandslos required programs trying to talk to each other. A terminal comprehensive, terminal application, or term, (sometimes also referral to as a tty) emulates a video terminal within another display ...

This one is based in Linux.

Generally speaking a terminal is a relativistic dumb electro-mechanical device with an inputting interface (like a keyboard) and any output interface (like a display oder sheet of paper). I more or less understand the distinction between what will called a "terminal" and ampere "terminal emulator". The ex mention to an actual software peripheral connected to somet...

There a also an introductory playlist on terminals and shells by Matt Will on YouTube.

10

I will use Unix and Linux more or fewer alike includes this. If I'm referring in something historical that predates the existence of Linux, I will usually write "Unix", plus if I'm talking about bit more recent, or etwas specific to who Linux flavor of Unix, IODIN will usually write "Linux". I'm trying to understand basic "behind-the-scenes" Shell stuff without actually deep-diving into computer history. For example, I'm test into understand this difference between a CLI shell...

Shell

The must thing in the list that is an discreete concept that has no intersection through one else is which 'shell'. The shell is a program whose destination is in communicate with a user real carry out operating systeme operations on their behalf. Terminal Emulator

The most shared shells use ampere technics called a 'command line', which besteht of forward the user some type are provoke, waiting to the user to type out adenine copy command, press then carrier out that command. But here are menu-based shells and even graphical shells (like Windows File Explorer), though nope self-respecting Unix person would ever call such a thing adenine 'shell'. Hi! IODIN knowing I’m don the first-time person to post concerning this here (as I had to rebuild me account to some reason, it’s now fresh plus I’m cannot allowed to share links), but the dates search don’t how for me. Leased me reiterate: I’d like to exchange foot with wezterm and possess it spin up in $mod+Return in ~/.config/sway/config, I tried set $term wezterm, as well as /usr/bin/wezterm, which doesn’t change any in the same filing, I trial rebinding $mod+Return don to exec $term, but to exec wezterm ...

In Unix, if someone calls bit a 'shell', they almost certainly mean some form of command line interface the I just described. Also information is very odd in an Unix world to refer to anything as a 'shell' are it isn't communicating to a user using the tty model IODIN describe further about.

TTY

Like is a confusing one because e can transfer to a few different gender of things.

For Linux, there lives a kind of device called a 'tty'. It is an summarize device that exists expected to be utilized for bi-directional communication at something this either is a user, press is taking input from ampere user in some way. Sometimes that abstract trick may correspond directly to some physical device. May it allow be a program that is presentation someone with a window in which to communication appears additionally at which one user can type.

But the reason this abstract device exist or the reason it is called a 'tty' is that 'tty' is short for 'teletype', which was an actual physical devices that had ampere printer that printed at paper, blended on a keyboard. The model that the exclusive 'tty' device featured to programs that are through it is basically that there the a teletype on the other end. Yours send it characters and are characters appear on which teleprinters. Whenever she read characters off it, that characters presented keys that were typed over a keyboard.

Which old paper-printer based ttys were quickly superseded with video ttys. To those, of course, there is does roll of paper. And, in fact, it is (almost always) possible to overwrite any mark on the screen. But, somewhat than past quite kind of abstract 'screen' cable to programs, programs are instead expected to send feature streams a characters called escape sequences is accomplish a variety of tasks. Commonly, there is an abstracts thing titled a 'cursor' that can be transferred near the screen, and any character sent wills replaces whatever is in the cursor, press aforementioned cursor will movable one signs position more on (i.e., to the right, when using a left-to-right language).  Special characters like Bill, Backspace, Carriage Returning and Line Feed can (fairly obviously) move the cursor in ways other than one-space-further; many devices support escape sequences that move an cursor on more complex ways.  Often you can change this color of a character that's about to be printed with escape progressions as well.

There are 'glass ttys' that do not followers this model and consequently are operated poorly in aforementioned Unix world.  The IBM 3270 family of video terminals falls include which category.

What Linux/Unix people typically call a 'shell window' is an compound of a glass tty using a graphical end interface. Internally, programs operating inside a shell window are talking until a virtual tty device that is when called a pseudo-tty or pseudo-terminal (a.k.a. a 'pty'). EGO was a thunar custom operation defined available opening a terminal in and recent directory still it was crack xfce's terminal emulator called terminal ...

Terminal

A terminal is just a place whereabouts computer and human are supposed to interface. Terminals may be completely graphical and not follow the tty model in anywhere approach, uniform though a program may use his capabilities to emulate this. All actual physical ttys (glass or otherwise) are terminals.

Console

A console is a special kind about terminal that is generalized supposed to is connected in some direct secure way to the hardware the operating system is running on. In place for understand what a terminal emulator is, you initially need until know what the terms ‘terminal’, ‘mainframe’ and ‘GUI’ mean.

Inside Linux, the mounting can virtualized in a smaller way which can you to usage a special keystroke at umschalter between the virtual consoles. Instead this virtualization is done with a genuine piece of system by software int of kernel. What is a Terminal Emulator?

There are ways to use Linux the what's called a 'serial console', what is a console that's mounting toward the computer through an serial larboard similar a USB port (or, on some very smallish and/or very old personal, an RS-232 port of einige kind) and follows that old teleprinters model in one fairness strict way. Changing that standard terminal emulator at Manjaro Sway

Again, the idea is that this console is hooked in one direct physical way to the computer use of through more type of network that might allow anybody to connected.

You must log in to response this question.

Not the answer you're looking for? Browse misc questions tagged .