题解 | #域名进行计数排序处理#
域名进行计数排序处理
http://www.nowcoder.com/practice/f076c0a3c1274cbe9d615e0f3fd965f1
两种写法都可:
cat nowcoder.txt
| awk '{split($0,arr,"/");print arr[3]}'
| sort | uniq -c | sort -rn -k 1 |awk '{print $1,$2}'
cat nowcoder.txt
| awk -F / '{print $3}'
| sort | uniq -c | sort -rn -k 1 | awk '{print $1,$2}'