美文网首页
2019-01-21 gd swarm3安装ripgrep——使

2019-01-21 gd swarm3安装ripgrep——使

作者: 五大RobertWu伍洋 | 来源:发表于2019-01-21 14:12 被阅读9次

    尝试使用centos 7的方式在gd swarm3安装,失败了:

    sudo yum-config-manager --add-repo=https://copr.fedorainfracloud.org/coprs/carlwgeorge/ripgrep/repo/epel-7/carlwgeorge-ripgrep-epel-7.repo
    
    sudo yum install ripgrep
    

    使用通用linux方式安装,成功! :

    wget  https://github.com/BurntSushi/ripgrep/releases/download/0.10.0/ripgrep-0.10.0-x86_64-unknown-linux-musl.tar.gz
    
    tar xzvf ripgrep-0.10.0-x86_64-unknown-linux-musl.tar.gz
    
    sudo cp ripgrep-0.10.0-x86_64-unknown-linux-musl/rg  /usr/local/bin/
    

    使用rg对日志过滤和统计(如下来自历史命令列表):

    342  rg --count-matches "MomoChat" |awk  'BEGIN{FS=":"}{print $2}'|tr -s "\n" "+"
      343  rg --count-matches "media_id=102" |awk  'BEGIN{FS=":"}{print $2}'|tr -s "\n" "+"
      345  rg --count-matches "media_id=102" ../20190119|awk  'BEGIN{FS=":"}{print $2}'|tr -s "\n" "+"
    351  rg --count-matches "media_id=102" |awk  'BEGIN{FS=":"}{print $2}'|tr -s "\n" "+"
    354  rg -m1  "media_id=102" 2019012010.txt
    

    相关文章

      网友评论

          本文标题:2019-01-21 gd swarm3安装ripgrep——使

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