That Looks Somewhat Iffy

Oh, go on, then.

  % history 1 | awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
  320 git
  112 ll
  80 cd
  48 ls
  24 less
  20 man
  19 happygiraffe.net
  17 sudo
  15 rm
  14 xattr

NB:

  1. This is at home, not work. At work, there’s significantly more git, ant, mvn and mate.
  2. I turn all my ssh known_hosts entries into command line aliases, hence “happygiraffe.net”.
  3. I’ve only just found xattr, so I’ve been playing with it.
  4. zsh only lists 25 history items by default. I have to ask it to start from the beginning.
  5. I obviously do too much as root.

As always, I can’t resist tinkering with the shell. I’d have written it as history 1 | awk '{print $2}' | sort | uniq -c | sort -rn | head.

Comments are Closed