Linux中sh命令怎么用(linux,sh,开发技术)

时间:2024-05-04 22:10:27 作者 : 石家庄SEO 分类 : 开发技术
  • TAG :

Linux常用命令sh命令 是shell命令语言解释器,执行命令从标准输入读取或从一个文件中读取。通过用户输入命令,和内核进行沟通。

Linux中sh命令怎么用

sh

shell命令解释器

补充说明

Bourne Again Shell (即bash)是自由软件基金会(GNU)开发的一个Shell,它是Linux系统中一个默认的Shell。Bash不但与Bourne Shell兼容,还继承了C Shell、Korn Shell等优点。

语法

bash[options][file]

选项

-cstring:命令从-c后的字符串读取。-i:实现脚本交互。-n:进行shell脚本的语法检查。-x:实现shell脚本逐条语句的跟踪。

实例

使用-x选项跟踪脚本调试shell脚本,能打印出所执行的每一行命令以及当前状态:

[root@AY1307311912260196fcZsatools]#sh-xcheck_ssh_login.sh+DEFINE=30+cat/var/log/secure+awk'/Failed/{++ip[$(NF-3)]}END{for(iinip)printi"="ip[i]}'++cat/root/satools/black.txt+foriin'`cat/root/satools/black.txt`'++echo121.42.0.16=1427++awk-F='{print$1}'+IP=121.42.0.16++echo121.42.0.16=1427++awk-F='{print$2}'+NUM=1427+'['1427-gt30']'+grep121.42.0.16/etc/hosts.deny+'['1-gt0']'+echosshd:121.42.0.16+echovsftpd:121.42.0.16+foriin'`cat/root/satools/black.txt`'++echo121.42.0.72=276++awk-F='{print$1}'+IP=121.42.0.72++awk-F='{print$2}'++echo121.42.0.72=276+NUM=276+'['276-gt30']'+grep121.42.0.72/etc/hosts.deny+'['1-gt0']'+echosshd:121.42.0.72+echovsftpd:121.42.0.72
 </div> <div class="zixun-tj-product adv-bottom"></div> </div> </div> <div class="prve-next-news">
本文:Linux中sh命令怎么用的详细内容,希望对您有所帮助,信息来源于网络。
上一篇:bootstrap中导航条怎么包裹下一篇:

5 人围观 / 0 条评论 ↓快速评论↓

(必须)

(必须,保密)

阿狸1 阿狸2 阿狸3 阿狸4 阿狸5 阿狸6 阿狸7 阿狸8 阿狸9 阿狸10 阿狸11 阿狸12 阿狸13 阿狸14 阿狸15 阿狸16 阿狸17 阿狸18