2008-04-17

History in Zsh

Since I use Zsh with shared history, the normal history command doesn't work properly. Instead I came up with this ugly hack using cat and cut:
cm@tyst> cat ~/.zshhistory | cut -c16-40 |awk '{a[$1]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
550 ls
496 cd
322 make
224 vim
168 su
151 screen
105 ssh
91 bitbake
76 rm
58 mtn
and for root:
root@tyst> cat ~/.zshhistory | cut -c16-40 |awk '{a[$1]++ } END{for(i in a){print a[i] " " i}}'|sort -rn|head
713 emerge
312 vim
247 ls
165 cd
120 screen
108 iptables
83 etc-update
60 top
59 dmesg
53 cp
Guess it's quite obvious what distro I use on my computer at home and what I spend time doing...

1 comment:

Cindy Dy said...
This comment has been removed by a blog administrator.