Ask HN: What are your top 10 most used CLI tools?
The following should work in bash/zsh
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
Mine are:
1 1922 19.1244% cd
2 1398 13.9104% git
3 1228 12.2189% fig
4 590 5.87065% open
5 497 4.94527% echo
6 309 3.07463% ls
7 275 2.73632% man
8 183 1.82090% heroku
9 175 1.74129% defaults
10 175 1.74129% curl
Source: https://superuser.com/questions/250227/how-do-i-see-what-my-most-used-linux-command-are
(
12 comments
| 13 points
| on HN
)
'awk|bash|bc|c[au]t|ch{own,grp,mod}|c{ol,mp,omm}|{ls,ll,file,cp,mv,rm,ln}|{cd,popd,pushd,pwd,{mk,rm}dir}|{cron,at,crontab}|diff|d[uf]|{clear|echo|tput}|[ fe]grep|{e{d,macs},vi[ m]}|{[ c]fdisk,fsck,[ u]mount}|{find,locate,whatis, whereis,which}|{more,less,pg}|pr|lp{r,admin}|{tr|sed|sort}|su{ ,do}|{ping,traceroute,netstat,ssh,rcp}|xargs|yes'
2 72 7,65957% youtube-dl
3 57 6,06383% sync
4 31 3,29787% apt-get
5 30 3,19149% cd
6 27 2,87234% hdparm
7 26 2,76596% ls
8 23 2,44681% netstat
9 19 2,02128% cat
10 15 1,59574% df