美文网首页
Shell教程

Shell教程

作者: 迷迷糊糊的番薯 | 来源:发表于2019-04-15 22:57 被阅读0次
  • grep 数据查找定位
  • awk 数据切片
  • sed 数据修改
    类比SQL
  • grep=select * from table
  • awk=select field from table
  • sed=update table set field=new where field=old

grep

  • grep pattern file
  • grep -i pattern file 忽略大小写
  • grep -v pattern file 不显示匹配的行
  • grep -o pattern file 把每个匹配的内容用独立的行显示
  • grep -E pattern file 使用扩展正则表达式
  • grep -A -B -C pattern file 打印命中数据的上下文
  • grep pattern -r dir/ 递归搜索

相关文章

网友评论

      本文标题:Shell教程

      本文链接:https://www.haomeiwen.com/subject/gfsmwqtx.html