麒麟操作系统操练Linux基操
<p>麒麟操作系统信息:<br><img src="https://img2020.cnblogs.com/blog/1150646/202101/1150646-20210125165544005-855545478.png"></p><p> </p>
<p> </p>
<p>基操准则:<br>教材名:Linux程序设计 <br>主编:严冰 刘加海 季江民<br>出版社:浙江大学出版社<br>备注:高等院校计算机技术 “十二五”规划教材</p>
<p> </p>
<p>第一章:Linux基本命令<br>1.1shell基础</p>
<p>通用shell种类:bash、TCShell、Korn Shell。 默认登录shell为bash。</p>
<p>可通过命令 tcsh或者chsh来改变默认登录shell。</p>
<p>各种shell程序放在 /bin目录下。</p>
<p>常用shell程序如下:</p>
<table style="height: 201px; width: 806px" border="0">
<tbody>
<tr>
<td style="text-align: center">shell名称</td>
<td style="text-align: center">存放的位置</td>
<td style="text-align: center">程序名</td>
</tr>
<tr>
<td style="text-align: center">Bourne shell</td>
<td style="text-align: center">/bin/sh->bash</td>
<td style="text-align: center">bash</td>
</tr>
<tr>
<td style="text-align: center">Bourne Again shell</td>
<td style="text-align: center">/bin/bash</td>
<td style="text-align: center">bash</td>
</tr>
<tr>
<td style="text-align: center">C Shell</td>
<td style="text-align: center">/bin/csh->tcsh</td>
<td style="text-align: center">tcsh</td>
</tr>
<tr>
<td style="text-align: center">TC Shell</td>
<td style="text-align: center">/bin/tcsh</td>
<td style="text-align: center">tcsh</td>
</tr>
<tr>
<td style="text-align: center">korn Shell</td>
<td style="text-align: center">/bin/ksh</td>
<td style="text-align: center">ksh</td>
</tr>
</tbody>
</table>
<p> </p>
<p>::::本机环境具有的 shell 程序如下:</p>
<p><img src="https://img2020.cnblogs.com/blog/1150646/202101/1150646-20210125171018235-1038018920.png"></p>
<p> </p>
<p> <img src="https://img2020.cnblogs.com/blog/1150646/202101/1150646-20210125171102495-1339129207.png"></p>
<p> </p>
<p> 1.shell的环境变量</p>
<p>bash环境变量名通常由大写英文字母组成。</p>
<p>任何时候都可以更改大多数的shell环境变量的值。在初始化文件 /etc/profile 和 /etc/csh.cshrc 中进行修改。</p>
<p>用户可以将用户创建的变量编程全局变量,也可以将环境变量编程全局变量, 这个工作也在初始化文件中自动完成。</p>
<p>用户的环境变量和全局变量存放在 : /home/用户名/.bash_profile文件。 </p>
<p>用户的历史命令记录存放在: /home/用户名/.bash_history文件。</p>
<p>部分bash环境变量:</p>
<p><img src="https://img2020.cnblogs.com/blog/1150646/202101/1150646-20210125174226872-67603146.png"></p>
<p>特别提出几个配置文件,以及相关网友的讲解连接:</p>
<p><img src="https://img2020.cnblogs.com/blog/1150646/202101/1150646-20210125181627424-1413971447.png"></p>
<p> </p>
<p>.bash_history文件: 记录历史执行的shell命令</p>
<p>.bash_logout文件:用户退出时执行的内容</p>
<p>.bash_profile文件:配置文件</p>
<p> https://blog.csdn.net/chinalinuxzend/article/details/1849419</p>
<p>https://blog.csdn.net/u011479200/article/details/86501366</p>
<p>https://blog.csdn.net/qinglongzhan/article/details/80478735</p>
<p> </p>
<p>2.shell元字符 metacharacters</p>
<p>元字符不能作为文本字符使用。 文件名中不可以使用元字符。</p>
<p>在命令中使用这些字符时不需要在他们的前面或者后面加上空格。</p>
<p><img src="https://img2020.cnblogs.com/blog/1150646/202102/1150646-20210212123630826-677712231.png"></p>
<p> </p>
<p> <img src="https://img2020.cnblogs.com/blog/1150646/202102/1150646-20210212124037723-1669075203.png"></p>
<p><img src="https://img2020.cnblogs.com/blog/1150646/202102/1150646-20210212130519322-1521414245.png"></p>
<p> </p>
<p>关于 元字符( )在子shell中执行, 点击当前链接跳转到拓展内容 : “父shell 和 子shell; shell脚本的几种执行方式” 。</p>
<p> </p><br><br>
来源:https://www.cnblogs.com/azbane/p/14326280.html
頁:
[1]