Created
May 11, 2016 16:07
-
-
Save kitelife/a148f3e52780109abbb7aa2352d8f0a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat words.txt | sort | uniq -c | sort -k1,1nr | head -10 | |
/* | |
sort: 对单词进行排序 | |
uniq -c: 显示唯一的行,并在每行行首加上本行在文件中出现的次数 | |
sort -k1,1nr: 按照第一个字段,数值排序,且为逆序 | |
head -10: 取前10行数据 | |
*/ | |
cat filter.log | awk -F '[' '{print $4}' | awk -F ':' '{print $1}' | sort | uniq -c | sort -k1,1nr | head -10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment