This version works for zsh (OSX/oh-my-zsh here):
history | \ awk '{CMD[$4]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | \ grep -v "./" | \ column -c3 -s " " -t | \ sort -nr | nl | head -n 5
1 1364 17,1206% ssh 2 928 11,648% ll 3 885 11,1083% ping 4 786 9,8657% vi 5 522 6,55203% git
Use this for easy zsh_stats
zsh_stats
Interesting.. the original version worked fine on osx with zsh for me, this version produces bad output:
1 4962 49.6051% 2 851 8.50745% -m 3 154 1.53954% | 4 122 1.21963% . 5 86 0.859742% -rd
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This version works for zsh (OSX/oh-my-zsh here):
Use this for easy
zsh_statsInteresting.. the original version worked fine on osx with zsh for me, this version produces bad output: