Grep 和awk的强大

我一牛同事研究的.太强大了.

time cat nohup.out | grep 'createNew: take' | awk -F' ' 'BEGIN {total=0; c=0} {total += $6; c += 1} END {print total; print c; print total / c}'

436765
199824
2.18575


real  0m0.901s
user 0m0.981s

sys  0m0.513s


[debug] application - createNew: take 0.540774 ms.

你可能感兴趣的:(Grep 和awk的强大)