Thursday, April 17, 2008

Profiling by Command History

I read a blog post about seeing what commands you use most in your shell. So I went ahead and executed the convoluted awk command to give me a pretty list:


[lucas@sarpedon ~]$ history|awk '{a[$2]++} END{for(i in a){ \
> printf "%5d\t%s \n",a[i],i}}'|sort -rn|head
193 vim
143 ssh
129 ls
108 clear
91 cd
69 screen
65 ruby
34 time
22 scp
19 top


And I got to thinking about how this can say a lot about how I use my computer and how I do my programming. First of all, it's obvious what text editor I use to code--Vim. Second, I obviously do a lot of my coding on other servers, since ssh is the second-ranked command. I use clear a lot because sometimes my CPU gets hot (Thunderbird has an annoying bug that causes it to top off my CPU for minutes at a time), which prints warning messages in my terminal window.

Anyway, sort of a silly diversion, but interesting nonetheless. What commands do you use most often? What does it indicate about your habits?