To go with this whole awk meme:
% history | awk '{a[$3]++ } END{for(i in a){print a[i] " " i}}' | sort -rn | head
37 latex
27 bibtex
13 cvs
4 ls
3 history
3 backupwork
2 xterm
2 emacs
2 clfiles
1 xdvi
Some notes:
ewww, emacs :p
Posted by: Shawn Wilsher on April 15, 2008 7:48 AMYou get better formatted columns with uniq. :-)
history | awk '{print $3}' | uniq -c | sort -nr | head
Posted by: anlan on April 15, 2008 10:38 AMGet thee behind me, oh vi-using infidel sdwilsh. ;)
Posted by: Boris on April 15, 2008 10:44 AMYou need anpther sort in there:
history | awk '{print $3}' | sort | uniq -c | sort -nr | head
to make sure all the commands get lumped into their own group.
Posted by: Michael on April 15, 2008 7:22 PM