DEV Community

Discussion on: What are your five most used terminal commands?

Collapse
 
chrismoeller profile image
Christoph Möller

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
Collapse
 
vunamhung profile image
Vũ Nam Hưng

Use this for easy zsh_stats

Collapse
 
willvincent profile image
Will Vincent

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