zshのhistoryコマンド使うよりも~/.zsh-history読んだほうが簡単だった

tail -5000 ~/.zsh-history | nkf -u | ruby -lane 'time, cmd = $_.scan(/^: (\d+):\d;(.+)$/)[0]; puts cmd.split(/\s/)[0] if time.to_i > Time.now.to_i-60*60*24' | sort | uniq -c | sort -nr


結果
 156 ruby
66 git
42 tail
40 node
38 ls
18 curl
15 npm
12 cat
11 heroku
10 history
9 cd
8 ssh
8 less
7 echo
6 mount_ramdisk
6 history-all
6 emacs
5 scp
5 mv
5 gem
5 bundle
4 screen
4 rm
3 mkdir
3 irb
3 cp
2 wc
2 tweet
2 touch
2 sh
2 markdown
2 df
1 which
1 wget
1 tw
1 rake
1 p
1 open
1 hostname
1 head
1 gi
1 chmod
1 ../tmp
1 ..