Initial commit

This commit is contained in:
Dichgrem 2024-03-12 22:03:32 +08:00
parent 4c8e5cb90b
commit c33cf80b7b
16 changed files with 899 additions and 171 deletions

View File

@ -0,0 +1,82 @@
+++
title = "TerminalConsole and Shell"
date = 2024-03-12
[taxonomies]
tags = ["Terminal","Console","Shell"]
+++
前言 在linux的学习过程中我们常常遇到诸如 TerminalConsolebash,zsh,shell,tty 等概念,这些概念常常被混淆,似乎都和命令行相关。本文从历史角度出发介绍它们的前世今生。
<!-- more -->
## 终端和控制台
终端,英文叫做 terminal ,通常简称为 term控制台英文叫做 console。
要明白这两者的关系,还得从最初的计算机说起。当时的计算机价格昂贵,一台计算机一般是由多个人同时使用的。在这种情况下一台计算机需要连接上许多套键盘和显示器来供多个人使用。在以前专门有这种可以连上一台电脑的设备,只有显示器和键盘,还有简单的处理电路,本身不具有处理计算机信息的能力,他是负责连接到一台正常的计算机上(通常是通过串口) ,然后登陆计算机,并对该计算机进行操作。当然,那时候的计算机操作系统都是多任务多用户的操作系统。这样一台只有显示器和键盘能够通过串口连接到计算机的设备就叫做终端。
而控制台又是什么回事呢?其概念来自于管风琴的控制台。顾名思义,控制台就是一个直接控制设备的台面(一个面板,上面有很多控制按钮)。 在计算机里,把那套直接连接在电脑上的键盘和显示器就叫做控制台。
终端是通过串口连接上的,不是计算机本身就有的设备,而控制台是计算机本身就有的设备,一个计算机只有一个控制台。计算机启动的时候,所有的信息都会显示到控制台上,而不会显示到终端上。也就是说,控制台是计算机的基本设备,而终端是附加设备。 当然,由于控制台也有终端一样的功能,控制台有时候也被模糊的统称为终端。
以上是控制台和终端的历史遗留区别。现在由于计算机硬件越来越便宜,终端和控制台的概念也慢慢演化了。终端和控制台由硬件的概念,演化成了软件的概念。
  
## 内核与外壳
内核( Kernel )和外壳( Shell )是 linux 的两个主要部分。Kernel 是操作系统的核心,系统的文件管理、进程管理、内存管理、设备管理这些功能,都是由 Kernel 提供的。
用户和操作系统内核交流需要一个工具,那么这个工具就是 Shell。
什么是 Shell在 Linux 中,最常见的 Shell 形式有命令行界面命令行界面和图形界面两种。并不是打开的那个终端窗口就是 Shell如Alacritty、Gnome-Terminal、xterm 、kitty等程序它们不是 Shell而它们里面运行的 Bash、Zsh、fish 等命令行解释器程序,才是 Shell。
那 Alacritty、Gnome-Terminal、xtermxterm 是什么?
它们是终端模拟器。
前面提到过,在远古时代,终端和控制台都是有实体的。控制台直接和计算机在一起,你可以通过控制台控制计算机。终端通过数据线和计算机连接,终端也提供一个键盘和一个屏幕,你可以通过键盘向计算机下达指令,然后通过屏幕观察输出。
但是现在的计算机组成和以前不一样了,一般一台电脑都是自带键盘和屏幕,很少再外接终端设备。
所以 Linux 提供了另外一个更高级的功能,那就是虚拟终端。那就是在一台电脑上,通过软件的模拟,好像有好几个终端连接在这台计算机上一样。
现在说的终端,比如 linux 中的虚拟终端,都是软件的概念。虚拟终端称之为 ttytty 是电传打字机电传打字机 Teletypewriter 的缩写在带显示屏的视频终端出现之前tty是最流行的终端设备。每一个 tty 都有一个编号,在/dev目录下有相应的设备文件。其中/dev/tty1到/dev/tty7可以通过 Ctrl+Alt+F1 到 Ctrl+Alt+F7 进行切换,也可以通过 chvt 命令进行切换,就好比是以前多人公用的计算机中的六个终端设备,这就是为什么这个叫“虚拟终端”的原因。
## 时代变迁
随着时间的推移,我们看到了从硬件到软件的转变,以及从多用户共享到个人使用的转变。这种变迁不仅影响了终端和控制台的概念,也塑造了我们对计算机的理解和期待。

View File

@ -79,6 +79,18 @@
<ul><li class="post-list"> <ul><li class="post-list">
<a href="https://blog.dich.ink/terminal-console-shell/">
<span class="post-date">2024-03-12</span>
:: <span class="post-list-title">TerminalConsole and Shell</span></a>
<span class="post-tags-inline">
::
<a class="post-tag" href="https://blog.dich.ink/tags/console/">#Console</a>,
<a class="post-tag" href="https://blog.dich.ink/tags/shell/">#Shell</a>,
<a class="post-tag" href="https://blog.dich.ink/tags/terminal/">#Terminal</a></span>
</li>
<li class="post-list">
<a href="https://blog.dich.ink/zola-blog/"> <a href="https://blog.dich.ink/zola-blog/">
<span class="post-date">2024-03-12</span> <span class="post-date">2024-03-12</span>
:: <span class="post-list-title">个人博客搭建记</span></a> :: <span class="post-list-title">个人博客搭建记</span></a>

View File

@ -7,6 +7,26 @@
<generator uri="https://www.getzola.org/">Zola</generator> <generator uri="https://www.getzola.org/">Zola</generator>
<updated>2024-03-12T00:00:00+00:00</updated> <updated>2024-03-12T00:00:00+00:00</updated>
<id>https://blog.dich.ink/atom.xml</id> <id>https://blog.dich.ink/atom.xml</id>
<entry xml:lang="en">
<title>TerminalConsole and Shell</title>
<published>2024-03-12T00:00:00+00:00</published>
<updated>2024-03-12T00:00:00+00:00</updated>
<author>
<name>
Unknown
</name>
</author>
<link rel="alternate" type="text/html" href="https://blog.dich.ink/terminal-console-shell/"/>
<id>https://blog.dich.ink/terminal-console-shell/</id>
<summary type="html">&lt;p&gt;前言 在linux的学习过程中我们常常遇到诸如 TerminalConsolebash,zsh,shell,tty 等概念,这些概念常常被混淆,似乎都和命令行相关。本文从历史角度出发介绍它们的前世今生。&lt;&#x2F;p&gt;
</summary>
</entry>
<entry xml:lang="en"> <entry xml:lang="en">
<title>个人博客搭建记</title> <title>个人博客搭建记</title>
<published>2024-03-12T00:00:00+00:00</published> <published>2024-03-12T00:00:00+00:00</published>

View File

@ -76,6 +76,42 @@
<div class="posts"> <div class="posts">
<div class="post on-list"> <div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/terminal-console-shell/">TerminalConsole and Shell</a></h1>
<div class="post-meta-inline">
<span class="post-date">
2024-03-12
</span>
</div>
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/console/">#Console</a>&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/shell/">#Shell</a>&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/terminal/">#Terminal</a></span>
<div class="post-content">
<p>前言 在linux的学习过程中我们常常遇到诸如 TerminalConsolebash,zsh,shell,tty 等概念,这些概念常常被混淆,似乎都和命令行相关。本文从历史角度出发介绍它们的前世今生。</p>
</div>
<div>
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
<a class="read-more button" href="https://blog.dich.ink/terminal-console-shell/">
<span class="button__text">Read more</span>&nbsp;
<span class="button__icon">&#8617;&#xFE0E;</span>
</a>
</div>
</div>
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/zola-blog/">个人博客搭建记</a></h1> <h1 class="post-title"><a href="https://blog.dich.ink/zola-blog/">个人博客搭建记</a></h1>
<div class="post-meta-inline"> <div class="post-meta-inline">
@ -143,41 +179,6 @@
</div> </div>
</div>
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/routing/">路由器原理与组网</a></h1>
<div class="post-meta-inline">
<span class="post-date">
2024-02-19
</span>
</div>
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/wifi/">#Wifi</a>&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/route/">#route</a></span>
<div class="post-content">
<p>前言 所谓无线路由,就是具备无线覆盖的路由器,即我们常用的有天线的家用路由器。而家庭组网中,除了选择一个最合适的上网方案,一部好的路由器也是非常重要;那么,如何科学的选购路由器呢?</p>
</div>
<div>
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
<a class="read-more button" href="https://blog.dich.ink/routing/">
<span class="button__text">Read more</span>&nbsp;
<span class="button__icon">&#8617;&#xFE0E;</span>
</a>
</div>
</div> </div>
<div class="pagination"> <div class="pagination">
<div class="pagination__buttons"> <div class="pagination__buttons">

View File

@ -76,6 +76,41 @@
<div class="posts"> <div class="posts">
<div class="post on-list"> <div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/routing/">路由器原理与组网</a></h1>
<div class="post-meta-inline">
<span class="post-date">
2024-02-19
</span>
</div>
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/wifi/">#Wifi</a>&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/route/">#route</a></span>
<div class="post-content">
<p>前言 所谓无线路由,就是具备无线覆盖的路由器,即我们常用的有天线的家用路由器。而家庭组网中,除了选择一个最合适的上网方案,一部好的路由器也是非常重要;那么,如何科学的选购路由器呢?</p>
</div>
<div>
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
<a class="read-more button" href="https://blog.dich.ink/routing/">
<span class="button__text">Read more</span>&nbsp;
<span class="button__icon">&#8617;&#xFE0E;</span>
</a>
</div>
</div>
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/podcast-use/">播客收听指北</a></h1> <h1 class="post-title"><a href="https://blog.dich.ink/podcast-use/">播客收听指北</a></h1>
<div class="post-meta-inline"> <div class="post-meta-inline">
@ -140,40 +175,6 @@
</div> </div>
</div>
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/chatogpt/">如何高效地向 ChatGPT 提问</a></h1>
<div class="post-meta-inline">
<span class="post-date">
2024-01-07
</span>
</div>
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/prompt/">#Prompt</a></span>
<div class="post-content">
<p>前言 本文翻译自《The Art of Asking ChatGPT for High-Quality Answers A Complete Guide to Prompt Engineering Techniques》</p>
</div>
<div>
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
<a class="read-more button" href="https://blog.dich.ink/chatogpt/">
<span class="button__text">Read more</span>&nbsp;
<span class="button__icon">&#8617;&#xFE0E;</span>
</a>
</div>
</div> </div>
<div class="pagination"> <div class="pagination">
<div class="pagination__buttons"> <div class="pagination__buttons">

View File

@ -76,6 +76,40 @@
<div class="posts"> <div class="posts">
<div class="post on-list"> <div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/chatogpt/">如何高效地向 ChatGPT 提问</a></h1>
<div class="post-meta-inline">
<span class="post-date">
2024-01-07
</span>
</div>
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/prompt/">#Prompt</a></span>
<div class="post-content">
<p>前言 本文翻译自《The Art of Asking ChatGPT for High-Quality Answers A Complete Guide to Prompt Engineering Techniques》</p>
</div>
<div>
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
<a class="read-more button" href="https://blog.dich.ink/chatogpt/">
<span class="button__text">Read more</span>&nbsp;
<span class="button__icon">&#8617;&#xFE0E;</span>
</a>
</div>
</div>
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/searching/">搜索引擎与爬虫</a></h1> <h1 class="post-title"><a href="https://blog.dich.ink/searching/">搜索引擎与爬虫</a></h1>
<div class="post-meta-inline"> <div class="post-meta-inline">
@ -141,40 +175,6 @@
</div> </div>
</div>
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/about-working/">应届生工作指南</a></h1>
<div class="post-meta-inline">
<span class="post-date">
2023-12-24
</span>
</div>
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/working/">#working</a></span>
<div class="post-content">
<p>前言 什么是“五险一金”?工资到底由那些部分组成?劳动合同怎么签?不仅仅是应届生,很多工作了几年的职场人,也不十分清楚。因此,在这里笔者打算帮助大家彻底把这些事情搞明白。</p>
</div>
<div>
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
<a class="read-more button" href="https://blog.dich.ink/about-working/">
<span class="button__text">Read more</span>&nbsp;
<span class="button__icon">&#8617;&#xFE0E;</span>
</a>
</div>
</div> </div>
<div class="pagination"> <div class="pagination">
<div class="pagination__buttons"> <div class="pagination__buttons">

View File

@ -76,6 +76,40 @@
<div class="posts"> <div class="posts">
<div class="post on-list"> <div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/about-working/">应届生工作指南</a></h1>
<div class="post-meta-inline">
<span class="post-date">
2023-12-24
</span>
</div>
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/working/">#working</a></span>
<div class="post-content">
<p>前言 什么是“五险一金”?工资到底由那些部分组成?劳动合同怎么签?不仅仅是应届生,很多工作了几年的职场人,也不十分清楚。因此,在这里笔者打算帮助大家彻底把这些事情搞明白。</p>
</div>
<div>
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
<a class="read-more button" href="https://blog.dich.ink/about-working/">
<span class="button__text">Read more</span>&nbsp;
<span class="button__icon">&#8617;&#xFE0E;</span>
</a>
</div>
</div>
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/android-root/">安卓刷机与root教程</a></h1> <h1 class="post-title"><a href="https://blog.dich.ink/android-root/">安卓刷机与root教程</a></h1>
<div class="post-meta-inline"> <div class="post-meta-inline">
@ -141,40 +175,6 @@
</div> </div>
</div>
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/calling-cards/">流量卡购买与套路</a></h1>
<div class="post-meta-inline">
<span class="post-date">
2023-08-24
</span>
</div>
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/calling-cards/">#Calling-cards</a></span>
<div class="post-content">
<p>前言 由于临近升学,校园网不尽人意,因此许多小伙伴有了买一张流量卡的计划。本文以三大运营商为例,说明常见流量卡的套路与选择。</p>
</div>
<div>
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
<a class="read-more button" href="https://blog.dich.ink/calling-cards/">
<span class="button__text">Read more</span>&nbsp;
<span class="button__icon">&#8617;&#xFE0E;</span>
</a>
</div>
</div> </div>
<div class="pagination"> <div class="pagination">
<div class="pagination__buttons"> <div class="pagination__buttons">

View File

@ -76,6 +76,40 @@
<div class="posts"> <div class="posts">
<div class="post on-list"> <div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/calling-cards/">流量卡购买与套路</a></h1>
<div class="post-meta-inline">
<span class="post-date">
2023-08-24
</span>
</div>
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/calling-cards/">#Calling-cards</a></span>
<div class="post-content">
<p>前言 由于临近升学,校园网不尽人意,因此许多小伙伴有了买一张流量卡的计划。本文以三大运营商为例,说明常见流量卡的套路与选择。</p>
</div>
<div>
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
<a class="read-more button" href="https://blog.dich.ink/calling-cards/">
<span class="button__text">Read more</span>&nbsp;
<span class="button__icon">&#8617;&#xFE0E;</span>
</a>
</div>
</div>
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/chromebook/">ChromeBook研究记</a></h1> <h1 class="post-title"><a href="https://blog.dich.ink/chromebook/">ChromeBook研究记</a></h1>
<div class="post-meta-inline"> <div class="post-meta-inline">
@ -141,40 +175,6 @@
</div> </div>
</div>
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/android-tv/">Android TV 折腾小记</a></h1>
<div class="post-meta-inline">
<span class="post-date">
2023-08-08
</span>
</div>
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/android-tv/">#android-TV</a></span>
<div class="post-content">
<p>前言 由于AppleTV的高昂的售价和普通电视盒子广告的泛滥一台开源、多功能的原生安卓电视盒子逐渐成为智能家居的必备神器。出于对IPTV、YouTube和家庭影院等需求以及对一面赏心悦目电视墙的期待这里分享Android TV 以下简称ATV安装的一些要点。</p>
</div>
<div>
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
<a class="read-more button" href="https://blog.dich.ink/android-tv/">
<span class="button__text">Read more</span>&nbsp;
<span class="button__icon">&#8617;&#xFE0E;</span>
</a>
</div>
</div> </div>
<div class="pagination"> <div class="pagination">
<div class="pagination__buttons"> <div class="pagination__buttons">

View File

@ -76,6 +76,40 @@
<div class="posts"> <div class="posts">
<div class="post on-list"> <div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/android-tv/">Android TV 折腾小记</a></h1>
<div class="post-meta-inline">
<span class="post-date">
2023-08-08
</span>
</div>
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/android-tv/">#android-TV</a></span>
<div class="post-content">
<p>前言 由于AppleTV的高昂的售价和普通电视盒子广告的泛滥一台开源、多功能的原生安卓电视盒子逐渐成为智能家居的必备神器。出于对IPTV、YouTube和家庭影院等需求以及对一面赏心悦目电视墙的期待这里分享Android TV 以下简称ATV安装的一些要点。</p>
</div>
<div>
<!-- &#xFE0E; -- force text style - some devices render this as emoji -->
<a class="read-more button" href="https://blog.dich.ink/android-tv/">
<span class="button__text">Read more</span>&nbsp;
<span class="button__icon">&#8617;&#xFE0E;</span>
</a>
</div>
</div>
<div class="post on-list">
<h1 class="post-title"><a href="https://blog.dich.ink/openwrt/">OpenWrt 软路由部署</a></h1> <h1 class="post-title"><a href="https://blog.dich.ink/openwrt/">OpenWrt 软路由部署</a></h1>
<div class="post-meta-inline"> <div class="post-meta-inline">

View File

@ -111,6 +111,9 @@
<url> <url>
<loc>https://blog.dich.ink/tags/chromebook/</loc> <loc>https://blog.dich.ink/tags/chromebook/</loc>
</url> </url>
<url>
<loc>https://blog.dich.ink/tags/console/</loc>
</url>
<url> <url>
<loc>https://blog.dich.ink/tags/debain/</loc> <loc>https://blog.dich.ink/tags/debain/</loc>
</url> </url>
@ -147,9 +150,15 @@
<url> <url>
<loc>https://blog.dich.ink/tags/searching/</loc> <loc>https://blog.dich.ink/tags/searching/</loc>
</url> </url>
<url>
<loc>https://blog.dich.ink/tags/shell/</loc>
</url>
<url> <url>
<loc>https://blog.dich.ink/tags/software/</loc> <loc>https://blog.dich.ink/tags/software/</loc>
</url> </url>
<url>
<loc>https://blog.dich.ink/tags/terminal/</loc>
</url>
<url> <url>
<loc>https://blog.dich.ink/tags/wifi/</loc> <loc>https://blog.dich.ink/tags/wifi/</loc>
</url> </url>
@ -159,6 +168,10 @@
<url> <url>
<loc>https://blog.dich.ink/tags/zola/</loc> <loc>https://blog.dich.ink/tags/zola/</loc>
</url> </url>
<url>
<loc>https://blog.dich.ink/terminal-console-shell/</loc>
<lastmod>2024-03-12</lastmod>
</url>
<url> <url>
<loc>https://blog.dich.ink/zola-blog/</loc> <loc>https://blog.dich.ink/zola-blog/</loc>
<lastmod>2024-03-12</lastmod> <lastmod>2024-03-12</lastmod>

View File

@ -0,0 +1,127 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>
Dich&#x27;blog</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5">
<meta name="robots" content="noodp"/>
<link rel="stylesheet" href="https://blog.dich.ink/style.css">
<link rel="stylesheet" href="https://blog.dich.ink/color/blue.css">
<link rel="stylesheet" href="https://blog.dich.ink/color/background_dark.css">
<link rel="stylesheet" href="https://blog.dich.ink/font-hack-subset.css">
<meta name="description" content="All posts tagged Console">
<meta property="og:description" content="All posts tagged Console">
<meta property="og:title" content="Dich'blog">
<meta property="og:type" content="website">
<meta property="og:url" content="https://blog.dich.ink/tags/console/">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:description" content="All posts tagged Console">
<meta name="twitter:title" content="Dich'blog">
<meta property="twitter:domain" content="blog.dich.ink">
<meta property="twitter:url" content="https://blog.dich.ink/tags/console/">
<link rel="alternate" type="application/atom+xml" title="RSS" href="https://blog.dich.ink/atom.xml">
</head>
<body class="">
<div class="container">
<header class="header">
<div class="header__inner">
<div class="header__logo">
<a href="https://blog.dich.ink" style="text-decoration: none;">
<div class="logo">
Dich&#x27;blog
</div>
</a>
</div>
</div>
<nav class="menu">
<ul class="menu__inner">
<li><a href="https://blog.dich.ink">blog</a></li>
<li class="active"><a href="https://blog.dich.ink/tags">tags</a></li>
<li><a href="https://blog.dich.ink/archive">archive</a></li>
<li><a href="https://blog.dich.ink/about">about me</a></li>
<li><a href="https://github.com/Dichgrem" target="_blank" rel="noopener noreferrer">github</a></li>
</ul>
</nav>
</header>
<div class="content">
<div class="post">
<h1 class="post-title">
tag: #Console
(1 post)
</h1>
<a href="https://blog.dich.ink/tags">
Show all tags
</a>
<ul><li class="post-list">
<a href="https://blog.dich.ink/terminal-console-shell/">
<span class="post-date">2024-03-12</span>
:: <span class="post-list-title">TerminalConsole and Shell</span></a>
<span class="post-tags-inline">
::
<a class="post-tag" href="https://blog.dich.ink/tags/console/">#Console</a>,
<a class="post-tag" href="https://blog.dich.ink/tags/shell/">#Shell</a>,
<a class="post-tag" href="https://blog.dich.ink/tags/terminal/">#Terminal</a></span>
</li>
</ul>
</div>
</div>
<footer class="footer">
<div class="footer__inner">
<div class="copyright">
<span>©
2024
Dichgrem</span>
<span class="copyright-theme">
<span class="copyright-theme-sep">:: </span>
Theme: <a href="https://github.com/pawroman/zola-theme-terminimal/">Terminimal</a> by pawroman
</span>
</div>
</div>
</footer>
</div>
</body>
</html>

View File

@ -122,6 +122,12 @@
</a> </a>
</li> </li>
<li class="tag-list">
<a href="https://blog.dich.ink/tags/console/">
Console (1 post)
</a>
</li>
<li class="tag-list"> <li class="tag-list">
<a href="https://blog.dich.ink/tags/debain/"> <a href="https://blog.dich.ink/tags/debain/">
Debain (1 post) Debain (1 post)
@ -194,12 +200,24 @@
</a> </a>
</li> </li>
<li class="tag-list">
<a href="https://blog.dich.ink/tags/shell/">
Shell (1 post)
</a>
</li>
<li class="tag-list"> <li class="tag-list">
<a href="https://blog.dich.ink/tags/software/"> <a href="https://blog.dich.ink/tags/software/">
software (1 post) software (1 post)
</a> </a>
</li> </li>
<li class="tag-list">
<a href="https://blog.dich.ink/tags/terminal/">
Terminal (1 post)
</a>
</li>
<li class="tag-list"> <li class="tag-list">
<a href="https://blog.dich.ink/tags/wifi/"> <a href="https://blog.dich.ink/tags/wifi/">
Wifi (1 post) Wifi (1 post)

View File

@ -0,0 +1,127 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>
Dich&#x27;blog</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5">
<meta name="robots" content="noodp"/>
<link rel="stylesheet" href="https://blog.dich.ink/style.css">
<link rel="stylesheet" href="https://blog.dich.ink/color/blue.css">
<link rel="stylesheet" href="https://blog.dich.ink/color/background_dark.css">
<link rel="stylesheet" href="https://blog.dich.ink/font-hack-subset.css">
<meta name="description" content="All posts tagged Shell">
<meta property="og:description" content="All posts tagged Shell">
<meta property="og:title" content="Dich'blog">
<meta property="og:type" content="website">
<meta property="og:url" content="https://blog.dich.ink/tags/shell/">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:description" content="All posts tagged Shell">
<meta name="twitter:title" content="Dich'blog">
<meta property="twitter:domain" content="blog.dich.ink">
<meta property="twitter:url" content="https://blog.dich.ink/tags/shell/">
<link rel="alternate" type="application/atom+xml" title="RSS" href="https://blog.dich.ink/atom.xml">
</head>
<body class="">
<div class="container">
<header class="header">
<div class="header__inner">
<div class="header__logo">
<a href="https://blog.dich.ink" style="text-decoration: none;">
<div class="logo">
Dich&#x27;blog
</div>
</a>
</div>
</div>
<nav class="menu">
<ul class="menu__inner">
<li><a href="https://blog.dich.ink">blog</a></li>
<li class="active"><a href="https://blog.dich.ink/tags">tags</a></li>
<li><a href="https://blog.dich.ink/archive">archive</a></li>
<li><a href="https://blog.dich.ink/about">about me</a></li>
<li><a href="https://github.com/Dichgrem" target="_blank" rel="noopener noreferrer">github</a></li>
</ul>
</nav>
</header>
<div class="content">
<div class="post">
<h1 class="post-title">
tag: #Shell
(1 post)
</h1>
<a href="https://blog.dich.ink/tags">
Show all tags
</a>
<ul><li class="post-list">
<a href="https://blog.dich.ink/terminal-console-shell/">
<span class="post-date">2024-03-12</span>
:: <span class="post-list-title">TerminalConsole and Shell</span></a>
<span class="post-tags-inline">
::
<a class="post-tag" href="https://blog.dich.ink/tags/console/">#Console</a>,
<a class="post-tag" href="https://blog.dich.ink/tags/shell/">#Shell</a>,
<a class="post-tag" href="https://blog.dich.ink/tags/terminal/">#Terminal</a></span>
</li>
</ul>
</div>
</div>
<footer class="footer">
<div class="footer__inner">
<div class="copyright">
<span>©
2024
Dichgrem</span>
<span class="copyright-theme">
<span class="copyright-theme-sep">:: </span>
Theme: <a href="https://github.com/pawroman/zola-theme-terminimal/">Terminimal</a> by pawroman
</span>
</div>
</div>
</footer>
</div>
</body>
</html>

View File

@ -0,0 +1,127 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>
Dich&#x27;blog</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5">
<meta name="robots" content="noodp"/>
<link rel="stylesheet" href="https://blog.dich.ink/style.css">
<link rel="stylesheet" href="https://blog.dich.ink/color/blue.css">
<link rel="stylesheet" href="https://blog.dich.ink/color/background_dark.css">
<link rel="stylesheet" href="https://blog.dich.ink/font-hack-subset.css">
<meta name="description" content="All posts tagged Terminal">
<meta property="og:description" content="All posts tagged Terminal">
<meta property="og:title" content="Dich'blog">
<meta property="og:type" content="website">
<meta property="og:url" content="https://blog.dich.ink/tags/terminal/">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:description" content="All posts tagged Terminal">
<meta name="twitter:title" content="Dich'blog">
<meta property="twitter:domain" content="blog.dich.ink">
<meta property="twitter:url" content="https://blog.dich.ink/tags/terminal/">
<link rel="alternate" type="application/atom+xml" title="RSS" href="https://blog.dich.ink/atom.xml">
</head>
<body class="">
<div class="container">
<header class="header">
<div class="header__inner">
<div class="header__logo">
<a href="https://blog.dich.ink" style="text-decoration: none;">
<div class="logo">
Dich&#x27;blog
</div>
</a>
</div>
</div>
<nav class="menu">
<ul class="menu__inner">
<li><a href="https://blog.dich.ink">blog</a></li>
<li class="active"><a href="https://blog.dich.ink/tags">tags</a></li>
<li><a href="https://blog.dich.ink/archive">archive</a></li>
<li><a href="https://blog.dich.ink/about">about me</a></li>
<li><a href="https://github.com/Dichgrem" target="_blank" rel="noopener noreferrer">github</a></li>
</ul>
</nav>
</header>
<div class="content">
<div class="post">
<h1 class="post-title">
tag: #Terminal
(1 post)
</h1>
<a href="https://blog.dich.ink/tags">
Show all tags
</a>
<ul><li class="post-list">
<a href="https://blog.dich.ink/terminal-console-shell/">
<span class="post-date">2024-03-12</span>
:: <span class="post-list-title">TerminalConsole and Shell</span></a>
<span class="post-tags-inline">
::
<a class="post-tag" href="https://blog.dich.ink/tags/console/">#Console</a>,
<a class="post-tag" href="https://blog.dich.ink/tags/shell/">#Shell</a>,
<a class="post-tag" href="https://blog.dich.ink/tags/terminal/">#Terminal</a></span>
</li>
</ul>
</div>
</div>
<footer class="footer">
<div class="footer__inner">
<div class="copyright">
<span>©
2024
Dichgrem</span>
<span class="copyright-theme">
<span class="copyright-theme-sep">:: </span>
Theme: <a href="https://github.com/pawroman/zola-theme-terminimal/">Terminimal</a> by pawroman
</span>
</div>
</div>
</footer>
</div>
</body>
</html>

View File

@ -0,0 +1,159 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Dich&#x27;blog</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5">
<meta name="robots" content="noodp"/>
<link rel="stylesheet" href="https://blog.dich.ink/style.css">
<link rel="stylesheet" href="https://blog.dich.ink/color/blue.css">
<link rel="stylesheet" href="https://blog.dich.ink/color/background_dark.css">
<link rel="stylesheet" href="https://blog.dich.ink/font-hack-subset.css">
<meta name="description" content="">
<meta property="og:description" content="">
<meta property="og:title" content="Dich'blog">
<meta property="og:type" content="article">
<meta property="og:url" content="https://blog.dich.ink/terminal-console-shell/">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:description" content="">
<meta name="twitter:title" content="Dich'blog">
<meta property="twitter:domain" content="blog.dich.ink">
<meta property="twitter:url" content="https://blog.dich.ink/terminal-console-shell/">
<link rel="alternate" type="application/atom+xml" title="RSS" href="https://blog.dich.ink/atom.xml">
</head>
<body class="">
<div class="container">
<header class="header">
<div class="header__inner">
<div class="header__logo">
<a href="https://blog.dich.ink" style="text-decoration: none;">
<div class="logo">
Dich&#x27;blog
</div>
</a>
</div>
</div>
<nav class="menu">
<ul class="menu__inner">
<li class="active"><a href="https://blog.dich.ink">blog</a></li>
<li><a href="https://blog.dich.ink/tags">tags</a></li>
<li><a href="https://blog.dich.ink/archive">archive</a></li>
<li><a href="https://blog.dich.ink/about">about me</a></li>
<li><a href="https://github.com/Dichgrem" target="_blank" rel="noopener noreferrer">github</a></li>
</ul>
</nav>
</header>
<div class="content">
<div class="post">
<h1 class="post-title"><a href="https://blog.dich.ink/terminal-console-shell/">TerminalConsole and Shell</a></h1>
<div class="post-meta-inline">
<span class="post-date">
2024-03-12
</span>
</div>
<span class="post-tags-inline">
:: tags:&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/console/">#Console</a>&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/shell/">#Shell</a>&nbsp;
<a class="post-tag" href="https://blog.dich.ink/tags/terminal/">#Terminal</a></span>
<div class="post-content">
<p>前言 在linux的学习过程中我们常常遇到诸如 TerminalConsolebash,zsh,shell,tty 等概念,这些概念常常被混淆,似乎都和命令行相关。本文从历史角度出发介绍它们的前世今生。</p>
<span id="continue-reading"></span><h2 id="zhong-duan-he-kong-zhi-tai">终端和控制台</h2>
<p>终端,英文叫做 terminal ,通常简称为 term控制台英文叫做 console。</p>
<p>要明白这两者的关系,还得从最初的计算机说起。当时的计算机价格昂贵,一台计算机一般是由多个人同时使用的。在这种情况下一台计算机需要连接上许多套键盘和显示器来供多个人使用。在以前专门有这种可以连上一台电脑的设备,只有显示器和键盘,还有简单的处理电路,本身不具有处理计算机信息的能力,他是负责连接到一台正常的计算机上(通常是通过串口) ,然后登陆计算机,并对该计算机进行操作。当然,那时候的计算机操作系统都是多任务多用户的操作系统。这样一台只有显示器和键盘能够通过串口连接到计算机的设备就叫做终端。</p>
<p>而控制台又是什么回事呢?其概念来自于管风琴的控制台。顾名思义,控制台就是一个直接控制设备的台面(一个面板,上面有很多控制按钮)。 在计算机里,把那套直接连接在电脑上的键盘和显示器就叫做控制台。</p>
<p>终端是通过串口连接上的,不是计算机本身就有的设备,而控制台是计算机本身就有的设备,一个计算机只有一个控制台。计算机启动的时候,所有的信息都会显示到控制台上,而不会显示到终端上。也就是说,控制台是计算机的基本设备,而终端是附加设备。 当然,由于控制台也有终端一样的功能,控制台有时候也被模糊的统称为终端。</p>
<p>以上是控制台和终端的历史遗留区别。现在由于计算机硬件越来越便宜,终端和控制台的概念也慢慢演化了。终端和控制台由硬件的概念,演化成了软件的概念。
  </p>
<h2 id="nei-he-yu-wai-ke">内核与外壳</h2>
<p>内核( Kernel )和外壳( Shell )是 linux 的两个主要部分。Kernel 是操作系统的核心,系统的文件管理、进程管理、内存管理、设备管理这些功能,都是由 Kernel 提供的。</p>
<p>用户和操作系统内核交流需要一个工具,那么这个工具就是 Shell。</p>
<p>什么是 Shell在 Linux 中,最常见的 Shell 形式有命令行界面命令行界面和图形界面两种。并不是打开的那个终端窗口就是 Shell如Alacritty、Gnome-Terminal、xterm 、kitty等程序它们不是 Shell而它们里面运行的 Bash、Zsh、fish 等命令行解释器程序,才是 Shell。</p>
<p>那 Alacritty、Gnome-Terminal、xtermxterm 是什么?</p>
<p>它们是终端模拟器。</p>
<p>前面提到过,在远古时代,终端和控制台都是有实体的。控制台直接和计算机在一起,你可以通过控制台控制计算机。终端通过数据线和计算机连接,终端也提供一个键盘和一个屏幕,你可以通过键盘向计算机下达指令,然后通过屏幕观察输出。</p>
<p>但是现在的计算机组成和以前不一样了,一般一台电脑都是自带键盘和屏幕,很少再外接终端设备。</p>
<p>所以 Linux 提供了另外一个更高级的功能,那就是虚拟终端。那就是在一台电脑上,通过软件的模拟,好像有好几个终端连接在这台计算机上一样。</p>
<p>现在说的终端,比如 linux 中的虚拟终端,都是软件的概念。虚拟终端称之为 ttytty 是电传打字机电传打字机 Teletypewriter 的缩写在带显示屏的视频终端出现之前tty是最流行的终端设备。每一个 tty 都有一个编号,在/dev目录下有相应的设备文件。其中/dev/tty1到/dev/tty7可以通过 Ctrl+Alt+F1 到 Ctrl+Alt+F7 进行切换,也可以通过 chvt 命令进行切换,就好比是以前多人公用的计算机中的六个终端设备,这就是为什么这个叫“虚拟终端”的原因。</p>
<h2 id="shi-dai-bian-qian">时代变迁</h2>
<p>随着时间的推移,我们看到了从硬件到软件的转变,以及从多用户共享到个人使用的转变。这种变迁不仅影响了终端和控制台的概念,也塑造了我们对计算机的理解和期待。</p>
</div>
<div class="pagination">
<div class="pagination__title">
<span class="pagination__title-h">Thanks for reading! Read other posts?</span>
<hr />
</div>
<div class="pagination__buttons">
<span class="button previous">
<a href="https://blog.dich.ink/zola-blog/">
<span class="button__icon"></span>&nbsp;
<span class="button__text">个人博客搭建记</span>
</a>
</span>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="footer__inner">
<div class="copyright">
<span>©
2024
Dichgrem</span>
<span class="copyright-theme">
<span class="copyright-theme-sep">:: </span>
Theme: <a href="https://github.com/pawroman/zola-theme-terminimal/">Terminimal</a> by pawroman
</span>
</div>
</div>
</footer>
</div>
</body>
</html>

View File

@ -132,6 +132,13 @@
</a> </a>
</span> </span>
<span class="button next">
<a href="https://blog.dich.ink/terminal-console-shell/">
<span class="button__text">TerminalConsole and Shell</span>&nbsp;
<span class="button__icon"></span>
</a>
</span>
</div> </div>
</div> </div>