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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章