My Top 10 Shell Commands

I came across this over on Planet Ubuntu from Ubuntu hacker Edward Robinson.  Entering the following pipeline into your bash terminal will give you the sorted list (by invocation count) of the top ten commands issued in your history:

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

Here’s my list:

111 ls
109 cd
57 vim
41 make
20 svn
18 sudo
14 patch
12 rm
12 gnome-mud
9 ./configure

I only had by bash history setup for 500 history items but I’ve upped it a bit now. I’m curious to see what my long term usage pattern looks like!

Leave a Reply

Your email address will not be published. Required fields are marked *