文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>第一章 shell简介

第一章 shell简介

时间:2006-05-11  来源:wumu888

第一章 shell简介      1.1什么是sell        1.1.1shell核心程序<kernel>之处的指令解析器,是一个程序,同时也是一种命令语言和程序设计语言;        1.1.2shell的类型ash.bash,ksh,csh,tcsh,可通过

[redhat@server redhat]$echo $SHELL    或

[redhat@server redhat]$echo ${SHELL}

进行查看;       1.1.3程序是在shell中运行的,是介于用户和kernel,就像汽车上的方向盘,是驾驶员和发动机的纽带,       1.1.3shell中可以运行子shell      1.2存取权限和安全         1.2.1文件和目录的权限(-rw-r--r--)可参考权限设置一文,         1.2.2setuid<suid/guid)(chmod u+s,g+s file)参考s位和t位讲解,         1.2.3chown和chgrp<chown user file/chgrp group file>         转换文件属主,和属组,         [root@server root]#chown redhat 学习bash  也可也成         [root@server root]#chown redhat:redhat 学习bash         属组:        [roor@server root]#chown redhat 学习bash        附:chown 和chgrp都一个R<递归参数>就是包含此目录的子目录;         1.2.4符号链接<ln [-s] source_path target_path>         举例说明:  硬链接;         [root@server root]#ls -l       -rw--r--r--1 root root 18201 Jun 21 2006 bash         [root@server root]#ln bash bash2 软链接:  [root@server root]#ln -s bash bash3         [root@server root]#ls -l bash*      -rw--r--r--1 root root 18201 Jun 21 2006 bash      -rw--r--r--1 root root 18201 Jun 21 2006 bash2      -rw--r--r--1 root root 13    Jun 21 2006 bash2       相信你的眼力并不差吧<-_->!         1.3shell简单脚本            1.3.1使用shell脚本的原因                  功能强大                  节约时间            1.3.2shell脚本基本元素                  #!/bin/bash   第一行必须要有的 #!/bin/bash                  #表示注释    #it is used to show "HELLO"                  变量         say="HELLO WORLD"                  流程控制结构   echo ${say}            1.3.3shell脚本运行方式                  要想运行shell脚本要给它赋予执行权限                  chmod u+x helloworld.sh                  要用绝对路径:                  [root@server root]#./helloworld.sh                  HELLO WORLD                  [root@server root]#         1.4shell特性            1.4.1别名<alias>              [root@server root]#alias ll='ls -alh'              自定义alias            1.4.2管道<|>               把一个命令的输出做另一个命令的输入               [root@server root]#ps -aux | grep "start"            1.4.3命令替换               [root@server root]#ls `cat myfile` -al            1.4.4后台处理              nohup command &            [root@server root]#nohup tar -zxvf 2.tar.gz            1.4.5变量            1.4.6重定向(<,>,<<,>>)            1.4.7模式匹配                正则表达式;                [root@server root]#ls -l *.txt            1.4.8特殊字符               4.8.1双引号(""):用来使shell无法认出空格,制表符和其它大多特殊字符,这样"David Medinets"表示一个值;               4.8.2单引号('')用来使使shell无法认出所有特殊字符;               4.8.3反引号(``)用来替换命令;               4.8.4反斜杠(\)用来使shell无法认出气候的特殊字符,使其后的支持付失去了其特殊的含义,如David\Medinets
相关阅读 更多 +
排行榜 更多 +
城市公交模拟器2019

城市公交模拟器2019

模拟经营 下载
假面骑士魂骑模拟器

假面骑士魂骑模拟器

模拟经营 下载
市政工程模拟器

市政工程模拟器

模拟经营 下载