前言
国家与国家之间存在语言、文化等的差异,中国人若想与英国人交流,下意识想到的一定是借助“翻译器”,那么翻译器就承担着承上启下的关键作用。同样的,在计算机中,人类若想完全操作计算机,对它发号施令,这里就一定也有着人类与计算机之间的“翻译器”------shell.
一、什么是shell
Shell俗称壳(用来区别于核),是指"为使用者提供操作界面"的软件(命令解析器)。它类似于DOS下的command.com和后来的cmd.exe。它接收用户命令,然后调用相应的应用程序。简而言之,它将人类的指令化为计算机能解读的“二进制”,计算机内核调用shell解读出来的二进制,随后,硬件调用内核执行人类的指令。Linux无法离开shell,换句话说,Linux离开shell则无法正常运行。
二、走进Linux
一、Linux的分类

二、LINUX操作命令格式
 
三、Type命令
1、中文:类型,品种,样式 2、计算机:查询该命令为外部亦或内部命令 3、举例:请在XSHELL操作中判断,cd/ls是内部还是外部? 
四、echo指令
1、含义:输出内容到控制台 2、基本语法:echo [选项] [输出内容] 3、案例1:使用echo指令输出环境变量 4、案例2:使用echo指令输出“hello,world” 
五、 Hash哈希
1、作用:将数据存入缓存中,运行时优先调用缓存中的数据 2、案例:hash 
六、Help指令
1、含义:获得shell内置命令的帮助信息(亦可查看内部命令) 2、基本语法:help 命令 3、案例:help cd(解释cd) 4、enable 同样也可以查看内部命令 
七、linux中你不知道的辅助骚操作

八、Man指令
1、基本语法:man ls 2、man cd(命令) /-i #(查找的功能选项) 3、查找参数:翻页n 向下 N 向上 4、案例:man ls | col -b > lshelp.txt 5、案例解析:在这个例子中,col 是一个命令程序,用于过滤文本中的一些特殊控制字符;另外还使 用了“|”和“>”符号,这是 Shell 环境中的两种特殊功能应用,分别称为管道、重定向输出。其 含义及作用如下所述。 ? 管道:用竖杠符号“|”表示,用于将前面命令的屏幕输出结果作为后面命令的操作对 象(输入)。就好像一根管道一样,从这头塞入内容,从另一头出来。 ?重定向输出:用大于符号“>”表示,前面的命令成功执行以后,其屏幕输出结果将 保存到“>”号后边指定的文件中,而不是直接输出到屏幕,因此称为重定向 6、man阅读手册页 6.1、使用上方向和下方向键滚动一行文本 6.2、使用Page Up和Page Down键翻页 6.3、按Q或q键退出阅读环境 6.4、按“\”键查找内容
九、pwd指令
1、基本语法:pwd 2、英文全称:print working directory 3、中文含义:显示当前工作目录的绝对路径 4、案例 显示当前工作的绝对路径 
十、cd指令
1、基本语法  2、案例 
十一、ls指令
1、基本语法:ls [选项][目录或文件] 2、选项:   3、案例  
十二、相对路径

十三、 Alias指令
1、基本指令:alias 命令别名=命令 2、中文翻译:别名 3、操作:vim /root/.bashrc ------ source /root/.bashrc   
十四、du指令
1、基本语法:du [选项][文件或目录] 2、常用选项  3、案例 

三、总结
只有当shell这位翻译官将人类的Linux指令转换为二进制,电脑才会真正的被人类所控制,在Linux中,外部为人类所操控。而内部为人类服务,当我们不知道该命令是内部还是外部时,type/help/enable最为顺手,当我们不知道该命令是什么意思时,man最为合适。当我们用户过多却对当前工作的目录混淆时,pwd最为合适,当我们工作时需要切换目录时,cd/cd~/cd-最为合适。当我们需要查找目录内容时,LS为我们提供帮助,当我们发现命令太长而经常被遗忘时。alias别名上线。当我们整理目录,希望为系统明确内存时,du指令就非常友好!
|