bindiego
7/1/2015 - 8:46 AM

top k in shell from a file

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