From 5b2ca3875a15bbae4f064cb98935461df2e93e15 Mon Sep 17 00:00:00 2001 From: CHH Date: Wed, 14 Nov 2012 19:09:13 +0800 Subject: [PATCH] Improved statistics functions, effect: 1 1124 24.6006% c 2 985 21.5583% git 3 343 7.50711% rails 4 328 7.17881% cd 5 314 6.8724% rspec 6 257 5.62486% la 7 197 4.31167% rake 8 154 3.37054% s 9 109 2.38564% .. 10 95 2.07923% rvm 11 68 1.48829% guard 12 36 0.787919% bundle 13 29 0.634712% ssh 14 28 0.612826% pry 15 27 0.590939% open 16 26 0.569052% middleman 17 26 0.569052% gem 18 24 0.525279% rm 19 24 0.525279% heroku 20 23 0.503392% nvm --- lib/functions.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/functions.zsh b/lib/functions.zsh index d2dcadd0c..63ab755cf 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -1,5 +1,5 @@ function zsh_stats() { - history | awk '{print $2}' | sort | uniq -c | sort -rn | head + history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20 } function uninstall_oh_my_zsh() {