您的位置:首页 > 运维架构 > Shell

Shell学习笔记1-1

2019-08-04 02:05 1176 查看
原文链接:http://www.cnblogs.com/birdgao/archive/2010/08/21/1805506.html

第一章Shell的介绍 

 什么是Shell?

 shell就是一个命令解析器。他的作用就是遵循一定的语法加以解释并传送给系统。

/etc/shells  通常有7种Shell,默认为 Bash,可运行子Shell,推出使用exit命令。

echo $SHELL 查看系统使用的Shell。 

 存取权限及安全 

 文档和目录的权限

  ls -alh    ll  查看文档的权限

 setuid(suid和guid)(chmod u+s,g+s file)

  chmod [who] operator [permission] file  

  who(u,g,o,a) operator(+,-,=) permission(r,w,x,s,t)

  chmod 4774 file 

  ps: chmod u+s,g+s file会给安全带来风险。但也可以引用在大型数据库等权限管理方面。  

 chown 和 chgrp (chown user file/ chgrp group file)

  chown [-R] owner file

  chgrp [-R] group file

umask

  $HOME/.bash_profile

  umask 0022 

符号链接(ln [-s] soure_path target_path)

 

 Shell 简单的命令

  shell脚本基本元素 

  #!/bin/bash

  # --注释

  变量

  流程控制

Shell 特性  

  别名   alis $HOME/.bashrc

  管道   ls| sort 

  命令替换 ·· 反单引号

  重定向  < >

  后台处理  nobup  command  &

  模式匹配  ×.txt   正则表达式

  变量

  特殊符号 

 

 

转载于:https://www.cnblogs.com/birdgao/archive/2010/08/21/1805506.html

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: