走进shell

news/2024/7/7 19:51:38

Linux系统启动时,会自动创建多个虚拟控制台。虚拟控制台是运行在Linux系统内存中的终端会话。
打开Linux控制台Terminal使用tty命令查看当前使用的虚拟控制台。
注:tty 表示电传打字机(teletypewriter)

$ tty
/dev/pts/0

表示当前使用的是/dev/pts/0 虚拟控制台。

同时可以使用setterm命令设置终端属性,例如

#交换屏幕背景色和前景色  如下图
$ setterm --inversescreen on

inversescreen off:
在这里插入图片描述
inversescreen on:
在这里插入图片描述
setterm帮助手册如下:

$ setterm --help

Usage:
 setterm [options]

Set the attributes of a terminal.

Options:
 --term          <terminal_name>   override TERM environment variable
 --reset                           reset terminal to power-on state
 --resize                          reset terminal rows and columns
 --initialize                      display init string, and use default settings
 --default                         use default terminal settings
 --store                           save current terminal settings as default
 --cursor        [on|off]          display cursor
 --repeat        [on|off]          keyboard repeat
 --appcursorkeys [on|off]          cursor key application mode
 --linewrap      [on|off]          continue on a new line when a line is full
 --inversescreen [on|off]          swap colors for the whole screen
 --foreground    default|<color>   set foreground color
 --background    default|<color>   set background color
 --ulcolor       [bright] <color>  set underlined text color
 --hbcolor       [bright] <color>  set half-bright text color
                 <color>: black blue cyan green grey magenta red white yellow
 --bold          [on|off]          bold
 --half-bright   [on|off]          dim
 --blink         [on|off]          blink
 --underline     [on|off]          underline
 --reverse       [on|off]          swap foreground and background colors
 --clear         [all|rest]        clear screen and set cursor position
 --tabs          [<number>...]     set these tab stop positions, or show them
 --clrtabs       [<number>...]     clear these tab stop positions, or all
 --regtabs       [1-160]           set a regular tab stop interval
 --blank         [0-60|force|poke] set time of inactivity before screen blanks
 --dump          [<number>]        write vcsa<number> console dump to file
 --append        [<number>]        append vcsa<number> console dump to file
 --file          <filename>        name of the dump file
 --msg           [on|off]          send kernel messages to console
 --msglevel      0-8               kernel console log level
 --powersave     [on|vsync|hsync|powerdown|off]
                                   set vesa powersaving features
 --powerdown     [0-60]            set vesa powerdown interval in minutes
 --blength       [0-2000]          duration of the bell in milliseconds
 --bfreq         <number>          bell frequency in Hertz
 --help                            display this help
 --version                         display version

For more details see setterm(1).

以上,通过各种命令于在终端下于Linux系统进行交互,使用的正是shell:
在这里插入图片描述
shell 通过提示您输入,向操作系统解释该输入,然后处理来自操作系统的任何结果输出,简单来说shell就是一个用户跟操作系统之间的一个命令解释器。

常见的 shell 有:

  • Bourne Shell(/usr/bin/sh或/bin/sh)
  • Bourne Again Shell(/bin/bash)
  • C Shell(/usr/bin/csh)
  • K Shell(/usr/bin/ksh)
  • Shell for Root(/sbin/sh)

最常用的shell是Bash,也就是Bourne Again Shell。Bash由于易用和免费,在日常工作中被广泛使用,也是大多数Linux操作系统默认的Shell环境。将在下篇文章中展开介绍。


http://lihuaxi.xjx100.cn/news/1952740.html

相关文章

vue使用sm2对手机号邮箱等加签名,数据完整性

vue使用sm2对手机号邮箱等加签名&#xff0c;数据完整性 1、安装依赖 npm install --save sm-crypto2、在utils文件下新建sm2Util.js // sm2Util.js const SM2 require(sm-crypto).sm2; const publicKey woshigongyao // 公钥 const privateKey woshisiyao // 私钥/* * 加…

66.网游逆向分析与插件开发-角色数据的获取-角色类的数据分析与C++还原

内容来源于&#xff1a;易道云信息技术研究院VIP课 ReClass.NET工具下载&#xff0c;它下方链接里的 逆向工具.zip 里的reclass目录下&#xff1a;注意它分x64、x32版本&#xff0c;启动是用管理员权限启动否则附加时有些进程附加不上 链接&#xff1a;https://pan.baidu.com/…

65、python - 利用手写的网络,成功预测一张图片

上面两节通过介绍了几种预处理方法,分别是 Resize and Crop 和 Normalization。在完成图像预处理之后,加上之前手动搭建的神经网络,其实我们就可以对图形进行推理识别了。 这一节我们使用自己手写的算法、自己搭建的神经网络,来第一次完成一张图像的识别。 下面对一些重要…

Springboot的配置文件详解:从入门到精通,解读配置文件的奇妙世界

目录 1、前言 2、介绍 2.1 Springboot配置文件的作用 2.2 Springboot支持的配置文件类型 2.3 Springboot配置文件的加载顺序 3、YAML配置文件 3.1 YAML基本语法介绍 3.2 YAML中的基本数据类型 3.3 YAML中的复合数据类型 3.4 YAML中的配置属性 3.5 YAML中的多环境配置…

网络协议与攻击模拟_03实施ARP欺骗和攻击

一、ARP攻击 1、实验环境 kali Linux &#xff08;安装arpspoof工具&#xff09;被攻击主机 2、kali配置 kali Linux系统是基于debian Linux系统&#xff0c;采用deb包管理方式&#xff0c;可以使用apt源的方式进行直接从源的安装。 配置kali网络源 vim /etc/apt/sources…

go 的内存布局和分配原理

go 之所以在高并发环境下表现优异&#xff0c;除了咱们都知道的 GMP 模型&#xff0c;其实 go 的内存布局和分配机制也起到了不少作用。 1. 分配内存三大组件 go 分配内存的过程&#xff0c;主要由三大组件所管理&#xff0c;级别从上到下分别是&#xff1a; mheap go 在程…

【SEO优化】之html语义化标签

ChatGPT4.0国内站点&#xff1a;海鲸AI HTML语义化标签是指那些具有明确含义或者能够清晰描述其代表内容或功能的标签。使用语义化标签不仅能够使网页的结构更加清晰&#xff0c;而且有助于搜索引擎优化&#xff08;SEO&#xff09;&#xff0c;并且提升网站的可访问性&#xf…

Qt QCheckBox复选按钮控件

文章目录 1 属性和方法1.1 文本1.2 三态1.3 自动排他1.4 信号和槽 2 实例2.1 布局2.2 代码实现 Qt中的复选按钮类是QCheckBox它和单选按钮很相似&#xff0c;单选按钮常用在“多选一”的场景&#xff0c;而复选按钮常用在"多选多"的场景比如喜欢的水果选项中&#xf…