Differences between console, terminal, virtual terminal, tty, shell, and other concepts

Source: Internet
Author: User

Differences between console, terminal, tty, shell, and other concepts

Linux has been used for some time, but I still cannot understand the differences between these concepts. Although I have been using it all the time, many concepts are vague, so it is really unpleasant to be unable to continue. These concepts are clarified below.

These concepts have a very strong history. With the development of the times, their meanings are changing, and some of them have lost their original meanings, however, their names are retained.

Console)

The Console is a physical device used for input and output. It is directly connected to a computer and is part of a computer system. Computer output information is displayed on the console, such as BIOS output and kernel output.

Terminal)

A Terminal is also a physical device used only for input and output and does not have powerful computing power. A computer has only one console. In the age of computing resources shortage, people want to share a computer. They can connect to the computer through a terminal and transmit the command input terminal to the computer, after the computer completes the command, it sends the output to the terminal and the terminal displays the result to the user.

Virtual Console and Virtual Terminal)

The Virtual Console is the same as the Virtual terminal. We only have one terminal (physical device), which is the user interface between us and the computer. If one day we want to have multiple user interfaces, on the one hand we can increase the number of terminals (physical devices), on the other hand, we can also on the same terminal (physical devices) virtual terminal, they do not affect each other, at least it seems that they do not affect each other. These terminals are virtual terminals.

In Ubuntu, when we press Ctrl + Alt + Fx, we enter the x Virtual terminal. There are seven virtual terminals, the seventh of which is the virtual terminal, is the graphical user interface we use by default.

Terminal Emulator)

We know that a Terminal is a physical device, and a Terminal Emulator is a program used to simulate a physical Terminal. The Terminal simulator in the graphic user interface is generally called the terminal Window. The gnome-Terminal we open in Ubuntu is like this.

Tty

Tty is TeleTYpewriter, an early terminal (physical device) used to send data to a computer and print the computer's return results. After the display appears, the terminal no longer prints the result, but displays it on the display. However, the tty name is retained.

In Ubuntu, when we press Ctrl + Alt + F1, we will enter 1st virtual terminals. You can see the tty1 shown above the screen.

Shell

Shell is different from the previous concepts. The previous concepts are related to computer input and output, while shell is related to the kernel. The kernel provides many services for upper-layer applications. The shell is on the upper layer of the kernel and on the lower layer of the application. For example, if you write a hello world Program and you do not explicitly create a process to run your program, you just need to hand over the program to shell, shell is responsible for creating processes for your program.

When we input commands in the terminal simulator, the terminal simulator itself does not explain how to execute these commands. It is only responsible for the input and output, and the shell that actually explains how to execute these commands.

THE sh, bash, and csh commands we usually use are different implementations of shell.

  • The concept of sh itself has its own ambiguity. It can refer to the name of a shell program and also represents the implementation of shell.

    Thompson shell is the first Unix shell, introduced by Ken Thompso in the first version of Unix in 1971. The shell program name is sh. As an alternative to Thompson shell, Bourne shell was introduced by Stephen Bourne in the seventh edition of Unix in 1977. Its program name is also sh. The Bourne shell is not only a command interpreter, but also a programming language that provides program control functions not available in the Thompson shell, along with Brian W. the UNIX Programming Environment published by Kernighan and Rob Pike has a reputation.

  • Csh is called C Shell, which was completed by Bill Joy in the late 1970s S. At that time, he was a graduate student at UC Berkeley. Tcsh is an upgraded version of csh. Unlike sh, the csh shell script syntax is similar to C language.

  • Bash is a free software developed by Brian Fox for the GNU project. It was released in 1989 as a substitute for the Bourne shell. Is the default shell for Linux and Mac OS X. The bash command syntax is a superset of The Bourne shell command syntax. It draws some ideas from ksh and csh.

    Well, I will write it here. The content above is what I wrote after referring to Wikipedia. It is not guaranteed to be completely correct. I also provide some materials below. If you are interested, please read it.

    Additional reading
    1. What is the exact difference between a 'terminal', a 'shell', a 'tty 'and a 'console '?

    2. What does shell, bash, zsh, console, and terminal mean and what is the relationship between them?

    3. Differences between shell, console, and terminal

    4. Why is a virtual terminal "virtual", and what/why/where is the "real" terminal?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.