I had a long cross-country flight today. Sleep wasn’t in the cards and I couldn’t make any code come out of my fingers.

So, on a whim, I poked and prodded at my shell history, eventually arriving at a list of my most frequently used commands:

sort $HISTFILE | uniq -c | sort --reverse

This sorts zsh‘s history file, which for me is ~/.history, tallies repeated lines, then sorts the most frequently-used lines towards the top.

Here’s what I got. Below is every command I’ve entered ten times or more since I installed Mac OS about six months ago.

 281 s
 168 g s
 111 r
  91 a
  66 x
  63 make && ./jam-1.0.0
  44 g d
  38 make && ./cheezus2-1.0.0
  36 ls
  35 b
  28 gulp
  27 ./cheezus2-1.0.0
  23 u
  22 rz
  22 make
  19 g l
  17 coffee
  15 g pp
  14 x ls
  14 ssh gany
  13 gulp && jpm -b ~/Applications/Firefox.app/Contents/MacOS/firefox run
  13 ez
  13 d
  11 ./make.js index.jade
  10 x testbed
  10 grunt serve
  10 fg

I’ll explain in detail below, but overall these results tell me that I’m generally keystroke-efficient in the terminal. Four of the top five results are one letter, and something like half of my oft-typed commands are under 5 characters. Bear in mind that even the longish commands here were tab-completed. I make heavy use of alphabeticals to slash the time I spend typing to–subjectively–an insignificant proportion of a given task. So while there’s no shortage of bullshit to hamper my efficiency, I can at least rest assured that typing isn’t contributing. Okay, that’s not entirely true because I use Confluence sometimes, but it’ll be a long time before Atlassian flushes that turd.

Other interesting notes…I’ve run just under 3000 commands total in zsh since I formatted my laptop in December. Of those, there are just under 1000 distinct commands, of which a whopping 768–over 75%–are unique, entered once and never again.

That’s about it. My shell history in, er, a nutshell. What’s yours?