Skip to content

Instantly share code, notes, and snippets.

@danielnc
Created November 7, 2012 11:09
Show Gist options
  • Save danielnc/4030891 to your computer and use it in GitHub Desktop.
Save danielnc/4030891 to your computer and use it in GitHub Desktop.
Bash COUNT && Percent
grep "XXXXXXX" file.log | cut -d"," -f5 | sort | awk '{a[$0]++} END{for (i in a) if (a[i]>1) printf "%10d\t%5.2f%%\t%s\n", a[i], 100*a[i]/NR, i}' | sort -rn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment