2018-04-28 ag better than grep

silversearcher-ag_0.19.2-1_amd64.deb

$ sudo apt-get install silversearcher-ag

ag + awk

$ ag "net->Forward" simple.log-0108-yolo-cb-log-ok | awk '{print $6}'
$ ag "net->Forward" simple.log-0108-yolo-cb-log-ok | awk '{print $6}' > test.log

    216295
    145365
    138829
    143813
    152775
    132817
    
同时打印多列
ag "Prepare Data" banchmark_time.log | awk '{print $2"\t"$6"\t\t"$9}' > prepareData.log

    10:00:28.297    Prepare         58.942
    10:00:28.304    Prepare         7.792
    10:00:28.379    Prepare         5.625
    10:00:28.392    Prepare         5.956
    10:00:28.402    Prepare         5.514
    10:00:28.461    Prepare         7.299
    10:00:28.475    Prepare         5.389
    10:00:28.487    Prepare         5.391 

你可能感兴趣的:(2018-04-28 ag better than grep)