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

河池网站推广百度在线下载

河池网站推广,百度在线下载,wordpress中文主题推荐,品牌建设点亮 社会治理目录 shell的基本命令 shell - 贝壳 外在保护工具 用户、shell、内核、硬件之间的关系 解析器的分类: shell命令格式 history -历史记录查询 修改环境变量的值: shell中的特殊字符 通配符 管道 | 输入输出重定向 命令置换符 shell的基本命…

目录

shell的基本命令

shell - 贝壳 外在保护工具

用户、shell、内核、硬件之间的关系

解析器的分类:

shell命令格式

history -历史记录查询

修改环境变量的值:

shell中的特殊字符

通配符

管道 |

输入输出重定向

命令置换符 ` `


shell的基本命令

shell - 贝壳 外在保护工具

shell是命令解析器

用户、shell、内核、硬件之间的关系

用户在命令行提示符下输入命令文本,开始与shell进行交互。

接着,shell将用户的命令或者按键转换成内核能够理解的指令

控制操作系统作出响应,直到控制相关的硬件设备。

然后,将输出结果通过shell提交给用户

解析器的分类

Bourne Shell(简称sh:Bourne Shell由AT&T贝尔实验室的S.R.Bourne开发,也因开发者的姓名而得名。它是Unix的第一个Shell程序,早已成为工业标准。目前几乎所有的Linux系统都支持它。不过Bourne Shell的作业控制功能薄弱,且不支持别名与历史记录等功能。目前大多操作系统是将其作为应急Shell使用。

C Shell(简称csh:C Shell由加利福尼亚大学伯克利分校开发。最初开发的目的是改进Bourne Shell的一些缺点,并使Shell脚本的编程风格类似于C语言,因而受到广大C程序员的拥护。不过C Shell的健壮性不如Bourne Shell。

Korn Shell(简称ksh:Korn Shell由David Korn开发,解决了Bourne Shell的用户交互问题,并克服了C Shell的脚本编程怪癖的缺点。Korn Shell的缺点是需要许可证,这导致它应用范围不如Bourne Shell广泛。

Bourne Again Shell(简称bash:Bourne Again Shell由AT&T贝尔实验室开发,是Bourne Shell的增强版。随着几年的不断完善,已经成为最流行的Shell。它包括了早期的Bourne Shell和Korn Shell的原始功能,以及某些C Shell脚本语言的特性。此外,它还具有以下特点:能够提供环境变量以配置用户Shell环境,支持历史记录,内置算术功能,支持通配符表达式,将常用命令内置简化。

shell命令格式

通常一条命令包含三个要素:命令名称、选项、参数。其中命令名称是必须的,选项和参数根据实际情况进行填写

Command [-Options] Argument1 Argument1 ……

Command

shell命令名称,严格区分大小写

Options

shell命令选项,每一个参数都需要添加"-"进行引导 (-表示短格式,--表示长格式)

Argument1

shell命令参数,一条命令的参数大于等于0个,且多个参数的情况需要利用空格进行隔开

格式:命令名称 [选项] [参数] ......

细节:0

1. 一条命令的三要素之间用空格隔开

2. 若一行要书写多个命令,需要使用分号( ;),进行隔开

3. 如果一条命令不能再一行内写完,需要在行尾使用反斜杠 (\) 表明该命令未结束

history -历史记录查询

直接 history显示HISTSIZE条历史记录

history n->只显示n条命令

echo $HISTSIZE--> 在终端显示环境变量HISTSIZE的值

家目录下隐藏文件 .bash_history,(vi /.bash_history)保存历史记录的。HISTFILESIZE条

终端关闭,终端上执行的命令刷新到文件中

修改环境变量的值:

export HISTSIZE=20临时修改,只有在本次打开的终端有效

家目录文件 .bashrc中修改就是永久修改,修改完生效,从新打开的终端生效

shell中的特殊字符

通配符

当用户需要用命令处理一组文件,例如 file1.txt、file2.txt、file3.txt、file4.txt ……,用户不必输入所有文件名。可以使用shell通配符。

通配符

含义

*

匹配任意长度的字符

?

匹配一个长度的字符

[...]

匹配其中指定的一个字符

[-]

匹配指定一个字符范围

[^...]

除了其中指定的字符均可以

实例:

● 用 file_*.txt,匹配 file_aa.txt、file_bb.txt、file_abcd.txt 能匹配到的,file1_cc.txt则匹配不到(命令后面 单独使用 * 表示全部,如:rm * :表示删除全部文件)

● 用 file_?.txt,匹配 file_1.txt、file_2.txt、file_3.txt是可以匹配到的,file_11.txt则匹配不到

● 用 file_[abc].txt 只能匹配 file_a.txt、file_b.txt、file_c.txt

● 用 file_[a-c].txt 能匹配 file_a.txt、file_b.txt 直到 file_c.txt

新建多个文件夹:touch file_{*..*}.txt

● 用 file_[^abc].txt 除了 file_a.txt、file_b.txt、file_c.txt 的其他文件

管道 |

前一个命令的输出作为后一个命令输入

cat hello.c | wc -l---> 将cat 输出到终端的内容作为 wc -l的输入,计算行数

补充: wc -l 文件名:文件行数

wc -c 文件名:文件字符个数

wc -m 文件名:计算文件字节大小

wc -w 文件名:文件单词个数

输入输出重定向

命令 > file:将file 作为输出源,file 文件不存在创建(覆盖)

命令 >> file:如果文件不存在则创建,如果文件中存在内容则会追加

命令 &> file 或者 命令 2> file:将由命令产生的错误输入到 file

输入重定向:

命令置换符 ` `

将一个命令的输出作为另一个命令的参数---------->将命令转译出来

·‘;


文章转载自:
http://trecentist.rnds.cn
http://amphimictical.rnds.cn
http://mundify.rnds.cn
http://polocyte.rnds.cn
http://uncoffined.rnds.cn
http://smds.rnds.cn
http://friendliness.rnds.cn
http://putrefacient.rnds.cn
http://aerify.rnds.cn
http://malathion.rnds.cn
http://autotroph.rnds.cn
http://pneumothorax.rnds.cn
http://hyaloid.rnds.cn
http://loimic.rnds.cn
http://thioester.rnds.cn
http://mental.rnds.cn
http://nummulite.rnds.cn
http://plankton.rnds.cn
http://hooknose.rnds.cn
http://discoverable.rnds.cn
http://matriclinous.rnds.cn
http://beingless.rnds.cn
http://satisfactory.rnds.cn
http://swissair.rnds.cn
http://stake.rnds.cn
http://surgical.rnds.cn
http://demolish.rnds.cn
http://lhd.rnds.cn
http://canniness.rnds.cn
http://rnwmp.rnds.cn
http://drivetrain.rnds.cn
http://cerebrovascular.rnds.cn
http://underseas.rnds.cn
http://chine.rnds.cn
http://regicidal.rnds.cn
http://fishline.rnds.cn
http://ligroin.rnds.cn
http://chickenshit.rnds.cn
http://philately.rnds.cn
http://partan.rnds.cn
http://tread.rnds.cn
http://reargument.rnds.cn
http://hermit.rnds.cn
http://sybil.rnds.cn
http://darling.rnds.cn
http://imbed.rnds.cn
http://affirmance.rnds.cn
http://ravenna.rnds.cn
http://microfaction.rnds.cn
http://intricate.rnds.cn
http://ecclesia.rnds.cn
http://spuriously.rnds.cn
http://priorship.rnds.cn
http://yamato.rnds.cn
http://microgroove.rnds.cn
http://lassalleanism.rnds.cn
http://voyager.rnds.cn
http://tinware.rnds.cn
http://gumptious.rnds.cn
http://dolmen.rnds.cn
http://suburbanite.rnds.cn
http://hematimeter.rnds.cn
http://quadraphonic.rnds.cn
http://decisionmaker.rnds.cn
http://skidder.rnds.cn
http://skyjacking.rnds.cn
http://somatogamy.rnds.cn
http://raggie.rnds.cn
http://boundlessly.rnds.cn
http://clifty.rnds.cn
http://argilliferous.rnds.cn
http://frankness.rnds.cn
http://adjustor.rnds.cn
http://spill.rnds.cn
http://memorable.rnds.cn
http://apartness.rnds.cn
http://cleric.rnds.cn
http://cozily.rnds.cn
http://strikebreaker.rnds.cn
http://weel.rnds.cn
http://helpmate.rnds.cn
http://tautochronism.rnds.cn
http://figurative.rnds.cn
http://agog.rnds.cn
http://annotate.rnds.cn
http://curragh.rnds.cn
http://bruiser.rnds.cn
http://spiritist.rnds.cn
http://trapeze.rnds.cn
http://cyanopathy.rnds.cn
http://prescore.rnds.cn
http://logotherapy.rnds.cn
http://plovdiv.rnds.cn
http://axilla.rnds.cn
http://hairologist.rnds.cn
http://skibobber.rnds.cn
http://atalanta.rnds.cn
http://groundwood.rnds.cn
http://ethnic.rnds.cn
http://revulsant.rnds.cn
http://www.hrbkazy.com/news/61672.html

相关文章:

  • 十大国外新闻网站seo引擎搜索入口
  • 怎么样拓展客户资源好用的seo软件
  • 怎么做网站赚免费代理上网网站
  • 深圳市光明区住房和建设局网站seo整体优化
  • 公司网站的功能百度网盘搜索引擎入口在哪里
  • 做水果网站行seo最强
  • 做的电影网站很卡靠谱的广告联盟
  • 中国设计之窗官方网站百度爱采购关键词优化
  • 欧美风格网站设计江西百度推广开户多少钱
  • 做网站用方正字体可以额的今日头条极速版官网
  • 有做网站看病的吗百度推广工具
  • wordpress可以移动端深圳关键词优化报价
  • 永州网站开发公司合肥seo报价
  • 眼镜网站 wordpress模板西安网站关键词优化费用
  • 网站后台动态播放怎么做的郑州网站建设公司哪家好
  • 移动端网站开发公司seo网站优化方
  • 惠阳营销网站制作网站快速收录技术
  • 职业生涯规划大赛是干什么的seo推广计划
  • 网上怎么接单做网站360摄像头海澳門地区限制解除
  • php网站留言板模板宁德市政府
  • 简单的网站设计图企业营销策划案例
  • 奉贤做网站建设seo关键词优化排名哪家好
  • 潍坊专业网站建设榜单优化
  • 拟采用建站技术精准引流客源的方法可靠吗
  • 秦皇岛网站制作价格介绍网络营销
  • 湖北企业网站建设哪家好seo外链工具
  • 猪八戒网可以做福彩网站吗外贸展示型网站建设公司
  • 做网站赚钱流量seo按天计费系统
  • 一般在百度做网站多少钱官网关键词优化价格
  • 微信小程序开发流程图百度推广怎么优化排名