The Top 10 Commands In Your Shell History
The Prokrammer » Blog Archive » Top 10 Commands In Your Shell History
I saw this post about the top ten commands in your shell history. The blog author wrote the query like so:
<quote>
$ history 1000 | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn
| head
114 cd
84 ls
79 irb
39 git
31 pedump
10 ps
10 objdump
10 e
8 ssh
8 dd
</quote>
I thought I could write something simpler using the base utilities:
<quote>
~ $ history 1000|sort -k2,2 | uniq -c -f1 | sort -rn|head|awk ‘{print $1″ “$3}’
4 ls
3 du
2 sudo
2 open
2 wget
2 rm
2 less
2 df
2 top
1 history
</quote>
But all I could think of after I ran my version was how pitiful my command history looked compared to the other guys. I know I have need to tweak my bashrc so it merges my history across open shells. But even taking that into consideration I realized that I am I doing all of my programming in the GUI.
Dang.
Tags: programming