shell 编写脚本需要会的工具和语法

1、常用命令

常用命令https://www.runoob.com/w3cnote/linux-common-command-2.html

sort

sort命令是帮我们依据不同的数据类型进行排序。参考地址:https://teakki.com/p/57dbcd9057cd1ab2139a73eb

uniq

从输入文件或者标准输入中筛选相邻的匹配行并写入到输出文件或标准输出 。参考地址:https://www.runoob.com/linux/linux-comm-uniq.html

awk

AWK 是一种处理文本文件的语言,是一个强大的文本分析工具。参考地址:https://www.runoob.com/linux/linux-comm-awk.html

sed

Linux sed 命令是利用脚本来处理文本文件。参考地址:https://www.runoob.com/linux/linux-comm-sed.html

grep

Linux grep 命令用于查找文件里符合条件的字符串。参考地址:https://www.runoob.com/linux/linux-comm-grep.html

cut

Linux cut命令用于显示每行从开头算起 num1 到 num2 的文字。参考地址:https://www.runoob.com/linux/linux-comm-cut.html

cat

cat 命令用于连接文件并打印到标准输出设备上。参考地址:https://www.runoob.com/linux/linux-comm-cat.html

head (自己百度一堆)

tail

tail 命令可用于查看文件的内容,有一个常用的参数 -f 常用于查阅正在改变的日志文件。参考地址:https://www.runoob.com/linux/linux-comm-tail.html

tr
Linux tr 命令用于转换或删除文件中的字符。参考地址:https://www.runoob.com/linux/linux-comm-tr.html
printf

制作标本比较方便:参考地址:https://www.runoob.com/linux/linux-shell-printf.html

echo

Shell 的 echo 指令与 PHP 的 echo 指令类似,都是用于字符串的输出。参考地址:https://www.runoob.com/linux/linux-shell-echo.html

2、语法

if 判断
https://blog.csdn.net/lxy___/article/details/106496813
for 循环
https://blog.csdn.net/lxy___/article/details/106497002
case多分支判断
https://blog.csdn.net/lxy___/article/details/106497152
while循环
https://blog.csdn.net/lxy___/article/details/106497228

function ==嵌套脚本 参考地址https://blog.csdn.net/lxy___/article/details/106497432
usage

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值