My ten most-frequently-used shell commands

Here they are:
$ history|awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
80 cd
59 svn
49 bzr
40 sudo
35 vi
32 nosetests
26 l
15 rfcomm
14 screen
14 c

l is an alias for ls and c is an alias for clear. rfcomm is how I connect to my mobile phone over a virtual serial port via bluetooth.

I’m happy that vi and nosetests are right next to each other. It looks like I’m pretty good about rerunning my test cases after editing.

I got the idea for this post from this guy.

5 thoughts on “My ten most-frequently-used shell commands

  1. Hmm – here is what I got:

    166 vi
    121 curl
    115 winto
    98 ssh
    45 ping
    44 cvs
    43 dig
    39 grep
    32 ./test-dc2-dc3
    32 cd

    This is just from my base machine at work – but since I generally work on many dozens of server I suppose I should come up with a really clever script to tally across all of them. For decoding – winto is an alias for screen/ssh and test-dc2-dc3 was a script i was working on to test tonights network maintenance. Not surprising that 4 of my top 5 command involved connecting to other machines. Interesting to see that vi is still the top.

  2. Hi Martin!

    You absolutely should write that script to grab logs from all those boxes.

    Anyhow, a good reason to never upgrade to python 2.5 is that 2.5 includes sqlite in the standard library.

  3. Matt & Martin…

    `history|perl -lane ‘$h{$F[1]}++;END{print”$h{$_} $_”for(sort{$h{$b}$h{$a}}keys%h)[0..9]}’`

Leave a Reply

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