5 ms·
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
- Breadmaker 6y ago1 270 28,7234% sudo 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
- diogenesjunior 6y ago1 32 22.695% ls 2 23 16.3121% python3 3 17 12.0567% cd 4 12 8.51064% clear 5 9 6.38298% grep 6 8 5.67376% git 7 7 4.96454% pip3 8 6 4.25532% rm 9 5 3.5461% nano 10 4 2.83688% unlink I just got a new PC, so the numbers aren't a good representation of how many times I use each command. I'd say that they're in order though.
- brendanfalk 6y agoCool. I don't think I've ever used the unlink command. Also interesting that `ls` is > `cd`
- thijsvandien 6y ago1 139 27.8% rg 2 68 13.6% cd 3 36 7.2% brew 4 28 5.6% pip 5 27 5.4% pyenv 6 24 4.8% ls 7 17 3.4% git 8 16 3.2% cat 9 13 2.6% ssh 10 12 2.4% sudo
- mod 6y agoDo you use rg as a file-finder while coding?
- thijsvandien 6y agoYes, intensively. The actual file isn't always important; often times I just care about the snippets containing a match, or simply the fact that there is one.
- dinkleberg 6y ago1 540 23.3766% ls 2 354 15.3247% cd 3 290 12.5541% kubectl 4 86 3.72294% git 5 63 2.72727% yarn 6 63 2.72727% mkdir 7 54 2.33766% ssh 8 52 2.25108% rm 9 47 2.03463% k9s 10 45 1.94805% scrapy
- frompdx 6y ago1 2466 23.2861% kubectl 2 1318 12.4457% vi 3 967 9.13126% cd 4 933 8.8102% ls 5 486 4.58924% docker 6 401 3.78659% terragrunt 7 334 3.15392% git 8 326 3.07838% curl 9 297 2.80453% janet 10 263 2.48347% cat
- sachinsmc 6y ago1 1188 13.5154% git 2 786 8.94198% ls 3 760 8.64619% cd 4 509 5.79067% npm 5 425 4.83504% ssh 6 410 4.66439% sudo 7 392 4.45961% node 8 257 2.92378% docker 9 249 2.83276% gst 10 182 2.07053% brew
- aprdm 6y ago1 1779 17.7918% ls 2 1732 17.3217% git 3 801 8.0108% cd 4 324 3.24032% docker 5 315 3.15032% vim 6 273 2.73027% rm 7 244 2.44024% curl 8 243 2.43024% ll 9 234 2.34023% cat 10 204 2.0402% docker-compose
- vram22 6y ago#!/bin/bash --loose-syntax $ 10 Error: command not found. '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'
- kleer001 6y ago1 270 9.97783% ls 2 236 8.72136% <custom crypto script> 3 188 6.94752% cd 4 158 5.83888% clear 5 148 5.46933% emacs 6 120 4.43459% sudo 7 104 3.84331% <custom script for writing> 8 98 3.62158% ll 9 70 2.58684% j 10 64 2.36511% <custom crypto script> -