Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

TIL #6: Top 10 Commands That You Use On Your Command-line Terminal

When you get bored, generate a histogram of your common commands.

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 -n10


     1  212  21.2%  ansible
     2  207  20.7%  ansible-playbook
     3  94   9.4%   cd
     4  69   6.9%   ll
     5  58   5.8%   cat
     6  55   5.5%   vim
     7  52   5.2%   ssh
     8  39   3.9%   vi
     9  35   3.5%   time
    10  33   3.3%   exit

Comments