控制台和终端区别_控制台,终端和外壳之间有什么区别?

控制台和终端区别_控制台,终端和外壳之间有什么区别?

控制台和终端区别

I see a lot of questions that are close but the questions themselves show an underlying misunderstanding of some important terms.

我看到许多很接近的问题,但是问题本身显示出对一些重要术语的潜在误解。

  • Why would I use Windows Terminal over PowerShell?

    为什么要在PowerShell上使用Windows终端?
  • I don't need WSL for bash, I use Cygwin.

    我不需要WSL进行打击,我使用Cygwin。
  • Can I use conemu with PowerShell Core or do I need to use Windows Terminal?

    我可以将conumu与PowerShell Core一起使用,还是需要使用Windows Terminal?

Let's start with a glossary and clarify some words first.

让我们从词汇表开始,首先澄清一些单词。

终奌站 (Terminal)

The word Terminal comes from terminate, indicating that it's the terminating end or "terminal" end of a communications process. You'll often hear "dumb terminal" when referring to a text-based environment where the computer you are sitting next to is just taking input and showing text while the real work happens at the other end in a mainframe or large computer.

终端来自终止一词,表示它是通信过程的终止端或“终端”端。 当您指的是基于文本的环境时,您经常会听到“哑终端”,您坐在旁边的计算机只是在进行输入并显示文本,而实际工作发生在大型机或大型计算机的另一端。

TTY or "teletypewriter" was the first kind of terminal. Rather than a screen you'd have a literal typewriter in front of you. When you type on it, you're seeing the text on a piece of paper AND inputing that text into a computer. When that computer replies, you'll see the typewriter automatically type on the same paper.

TTY或“ teletypewriter”是第一种终端。 而不是屏幕,您的面前是一台文字打字机。 键入时,您会在纸上看到文本并将其输入计算机。 当该计算机回复时,您会看到打字机自动在同一张纸上打字。

控制台和终端区别_控制台,终端和外壳之间有什么区别?

When we refer to a Terminal in the software sense, we're referring to a literal software version of a TTY or Terminal. The Windows Terminal is that. It's really good at displaying textual output. It can take input and pass it on. But the Terminal isn't smart. It doesn't actually process your input, it doesn't look at your files or think.

当我们从软件意义上指终端时,我们指的是TTY或终端的字面软件​​版本。 Windows终端就是这样。 在显示文本输出方面确实很棒。 它可以接受输入并继续传递。 但是终端并不聪明。 它实际上并不会处理您的输入,也不会查看您的文件或思想

安慰 (Console)

Folks in the mid 20th century would have a piece of furniture in their living room called a console or console cabinet. A Console in the context of computers is a console or cabinet with a screen and keyboard combined inside it. But, it's effectively a Terminal. Technically the Console is the device and the Terminal is now the software program inside the Console.

20世纪中叶的人们在客厅里会拥有一件称为控制台或控制台柜的家具。 在计算机上下文中,控制台是其中结合了屏幕和键盘的控制台或机柜。 但是,它实际上是一个终端。 从技术上讲,控制台是设备,而终端现在是控制台内的软件程序。

控制台和终端区别_控制台,终端和外壳之间有什么区别?

In the software world a Terminal and a Console are, for all intents, synonymous.

在软件世界中,终端和控制台实际上是同义词。

贝壳 (Shell)

A shell is the program that the terminal sends user input to. The shell generates output and passes it back to the terminal for display. Here's some examples of Shells:

Shell是终端向其发送用户输入的程序。 Shell生成输出,并将其传递回终端以显示。 以下是一些Shell的示例:

  • bash, fish, zsh, ksh, sh, tsch

    bash,鱼,zsh,ksh,sh,tsch
  • PowerShell, pwsh

    PowerShell,pwsh
  • cmd, yori, 4dos, command.com

    cmd, yori ,4dos,command.com

Here's an important point that should make more sense now that you have these terminals - Your choice of shell doesn't and shouldn't dictate your choice of terminal application.

现在,有了这些终端,这是一个更有意义的要点-您对Shell的选择没有也不应决定您对终端应用程序的选择。

Aside: WSL and WSL2 (the Windows Subsystem for Linux) are a complete local Linux (or many Linuxes) that run on Windows 10. They are full and real. WSL2 ships a real Linux kernel and runs in on Windows. Cygwin is NOT a Linux. Cygwin is a large collection of GNU and Open Source tools which provide functionality similar to Linux on Windows - but it is not Linux. It's a simulacrum. It's GNU utils compiled against Win32. It's great, but it's important for you to know what the difference is. Cygwin may let you run your bash shell scripts but it will NOT run Apache, Docker, or other real ELF-binaries and Linux apps.

另外: WSL和WSL2(Linux的Windows子系统)是在Windows 10上运行的完整的本地Linux(或许多Linux)。它们是完整而真实的。 WSL2附带了一个真正Linux内核,并且可以在Windows上运行。 Cygwin不是Linux。 Cygwin是GNU和开放源代码工具的大集合,它们提供的功能类似于Windows上Linux,但不是Linux。 这是一个模拟。 它是针对Win32编译的GNU utils。 很棒,但对您来说有什么区别也很重要。 Cygwin可以让您运行bash shell脚本,但不能运行Apache,Docker或其他真正的ELF二进制文件和Linux应用程序。

您选择Windows控制台吗? (Your Choice of Windows Consoles?)

There are a number of shells that ship with Windows. Here's a few I'm running now. Note the "chrome" or the border and title around them? Those shells are all hosted by a the legacy Windows console you have never heard of called conhost.exe. You can go to the command prompt, type powershell, cmd, or ubuntu and any number of shells will run. Conhost does the work of input and output.

Windows附带许多外壳。 这是我现在正在运行的一些。 注意“ chrome”或它们周围的边框和标题吗? 这些外壳程序均由一个您从未听说过的旧版Windows控制台conhost.exe托管。 您可以转到命令提示符,键入powershell,cmd或ubuntu,然后将运行任意数量的shell。 Conhost完成输入和输出的工作。

Now, forget that conhost exists, because it sucks - it's super old.

现在,请忘记存在conhost,因为它很烂-它已经过时了。

控制台和终端区别_控制台,终端和外壳之间有什么区别?

伪控制台,伪终端,PTY,伪TTY( ConPTY ) (Pseudo Console, Pseudo Terminal, PTY, Pseudo TTY (ConPTY))

Pseudo Terminals are terminal emulators or software interfaces that emulate terminals. They pretend to be terminals like the ones above. *Nix systems have long had a pseudo-terminal (PTY) infrastructure and now Windows as a pseudoconsole (ConPTY) as well.

伪终端是终端仿真器或模拟终端的软件接口。 他们假装像上述终端一样。 *长期以来,Nix系统具有伪终端(PTY)基础结构,现在Windows也具有伪控制台(ConPTY)

Window's new ConPTY interface is the future of consoles and terminals on Windows. If you choose a 3rd party (non-built-in) console applications for Windows, make sure it supports ConPTY and it'll be a better experience than some of the older consoles that use screen scraping or other hacks.

Window的新ConPTY界面是Windows上的控制台和终端的未来。 如果您选择适用于Windows的第三方(非内置)控制台应用程序,请确保它支持ConPTY,并且与使用屏幕抓取或其他黑客手段的某些较旧的控制台相比,它将提供更好的体验。

控制台和终端区别_控制台,终端和外壳之间有什么区别?

返回您选择的Windows控制台 (Back to your choice of Windows Consoles)

Remembering there's a lot of shells you can use in Windows, there's a lot of 3rd party consoles you can use if you don't like conhost.exe (and you shouldn't).

记住,在Windows中可以使用很多外壳程序,如果您不喜欢conhost.exe(并且您不应该),可以使用很多第三方控制台。

All of these Terminals support ALL the shells above and any shells I've missed. Because a shell isn't a terminal. Pick the one that makes you happy. I use PowerShell Core and Ubuntu in WSL2 in the Windows Terminal.

所有这些终端都支持上面的所有外壳以及我错过的所有外壳。 因为外壳不是终端。 选择一个让你开心的东西。 我在Windows终端的WSL2中使用PowerShell Core和Ubuntu。

控制台和终端区别_控制台,终端和外壳之间有什么区别?

Hope this helps clear things up.

希望这有助于清理问题。



Sponsor: Suffering from a lack of clarity around software bugs? Give your customers the experience they deserve and expect with error monitoring from Raygun.com. Installs in minutes, try it today!

发起人:是否对软件错误缺乏明确的了解? 通过Raygun.com进行错误监视,为您的客户提供应有的期望和期望的体验。 几分钟即可安装,立即尝试!

关于斯科特 (About Scott)

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

斯科特·汉塞尔曼(Scott Hanselman)是前教授,前金融首席架构师,现在是演讲者,顾问,父亲,糖尿病患者和Microsoft员工。 他是一位失败的单口相声漫画家,一个玉米种植者和一本书的作者。

控制台和终端区别_控制台,终端和外壳之间有什么区别?
控制台和终端区别_控制台,终端和外壳之间有什么区别?
控制台和终端区别_控制台,终端和外壳之间有什么区别?
About   关于 Newsletter 时事通讯
Hosting By 主持人
控制台和终端区别_控制台,终端和外壳之间有什么区别?

翻译自: https://www.hanselman.com/blog/whats-the-difference-between-a-console-a-terminal-and-a-shell

控制台和终端区别