DEV Community

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

Collapse
 
hmphu profile image
Phu Hoang

This version work for OSX fish-shell (github.com/fish-shell/fish-shell)

history | \                                                                                                                                                                                                                                                               0
     awk '{CMD[$1]++;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

My commands:

     1  403  35.3819%    git
     2  81   7.1115%     cd
     3  67   5.88235%    vi
     4  63   5.53117%    ssh
     5  58   5.09219%    grep