top k in shell from a file
#!/bin/bash # 1 cat file|format key|sort | uniq -c | sort -nr | head -n 10 # 2 clean version cat file | sort | uniq -c | sort -nr | head -n 10