This is a read-only archive!

Meme

Picked up a meme from here, may as well spread it around.

~ $ history|awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
2394 cd
1879 ls
1017 vim
998 sudo
890 bzr
732 ruby
585 rm
538 mv
493 find
412 svn

The only reason vim is so low is because I usually start gvim from my KDE menu. Sudo is in that list because my .bash_history stretches back through my Ubuntu phase almost a year ago. At some point I should probably clean out my history file.

April 15, 2008 @ 12:09 PM PDT
Cateogory: Linux
Tags: Meme, Linux

4 Comments

Ivar Refsdal
Quoth Ivar Refsdal on April 15, 2008 @ 6:42 PM PDT

Pretty nice. I added this for fun:

history|awk '{a[$2]++; total++ } END{for(i in a){print a[i] " (" (a[i]/total)*100 "%) " i}}'|sort -rn|head

191 (38.2%) ssh 74 (14.8%) ping 46 (9.2%) ls 37 (7.4%) cd 24 (4.8%) ./goslime 13 (2.6%) vim 12 (2.4%) exit 9 (1.8%) ./gogo 8 (1.6%) python 7 (1.4%) /bin/sh

I did a different awk one-liner here. Cheers :)

Ivar Refsdal
Quoth Ivar Refsdal on April 15, 2008 @ 6:44 PM PDT

Hmm.. Maybe this will work better?

history|awk '{a[$2]++; total++ } END{for(i in a){print a[i] " (" (a[i]/total)*100 "%) " i}}'|sort -rn|head

Ivar Refsdal
Quoth Ivar Refsdal on April 15, 2008 @ 6:46 PM PDT

Nopes. Double and single quotes "s are still broken.

Ivar Refsdal
Quoth Ivar Refsdal on April 15, 2008 @ 6:49 PM PDT

history|awk '{a[$2]++; total++ } END{for(i in a){print a[i] " (" (a[i]/total)*100 "%) " i}}'|sort -rn|head

Hopefully that works...