当前位置: 首页 > news >正文

走进shell

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

$ tty
/dev/pts/0

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

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

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

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

$ setterm --helpUsage: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 versionFor 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://www.lryc.cn/news/277635.html

相关文章:

  • 【Python】使用tkinter设计开发Windows桌面程序记事本(2)
  • Flutter DateTime 常用处理
  • 【uniapp】APP打包上架应用商-注意事项
  • 【算法题】43. 字符串相乘
  • CH341 SPI方式烧录BK7231U
  • sd-webui-EasyPhoto win 安装笔记
  • gradient_checkpointing
  • 回溯算法part05 算法
  • 阿里云系统盘测评ESSD、SSD和高效云盘IOPS、吞吐量性能参数表
  • RK3568平台开发系列讲解(Linux系统篇)Linux 内核打印
  • 迁移学习的最新进展和挑战
  • Python基础(二十二、自定义模块和包)
  • C#-数组
  • 机器学习周刊第二期:300个机器学习应用案例集
  • 【华为OD机试真题2023CD卷 JAVAJS】中文分词模拟器
  • 基于YOLOv8-pose的画笔关键点(bic_markers)检测
  • 【实用技巧】Windows 电脑向iPhone或iPad传输视频方法1:无线传输
  • 爬虫实战 - 微博评论数据可视化
  • python装饰器嵌套基础
  • C语言之三子棋小游戏的应用
  • 优雅处理并发:Java CompletableFuture最佳实践
  • 熟悉HDFS常用操作
  • Adobe XD是什么?探索这款创新的用户体验设计工具
  • java常用应用程序编程接口(API)——ArrayList概述及使用案例
  • 2024年了,Layui再战三年有问题不?
  • 消息队列-RocketMQ-概览与搭建
  • Vue3技术解析(小册子)
  • 即将消失的五种编程语言?
  • c++学习:STL库(框架)+字符串模板类string+vector容器+list链表
  • 2023年全国职业院校技能大赛(高职组)“云计算应用”赛项赛卷④