Recently I came across a thread on reddit which asked users the most used command in their shell history.
My results:
1 419 13.0489% git
2 265 8.25288% cd
3 239 7.44316% sudo
4 122 3.79944% cat
5 77 2.39801% which
6 76 2.36686% dkr
7 72 2.24229% rm
8 60 1.86858% rg
9 57 1.77515% yarn
10 57 1.77515% nvim
Obviously git is my most used command because I ran it on my work laptop. It should be a lot more but I have been using prezto's git aliases lately. Other common commands are dkr which is an alias for sudo docker and rg, the binary for ripgrep.
I wonder how is it for the dev.to community?
Use this command from linux.byexample.com to list your most used 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
I use zsh and it was not working for me because zsh's history command just prints a few most recent commands only. I had to tweak it a bit:
history 1 | cat | 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
# or
fc -l 1 | 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
Latest comments (31)
aka a bunch of git shortcuts, the infamouse
npmfornpm starton all my projects, yet more git stuffnumber 11 is nvim with 51 :D
Flutter, am I right?
I mainly work via ssh, so my total commands differ there.
On my main VM lots of DNS queries, talking to other machines and inline loops; and oh, some heavy ansible testing made its way to the top 10
I'm more of a sysadmin guy as you might have guessed by
gitbeing only on 7 :DI honestly didn't expect qemu to be there lol
I might be a software engineer by title, but really a sysadmin by necessity.
I didn't expect to see
exitandclearso much but I suppose it makes sense with all thetmuxpanes being created and destroyed and my habit of clearing the screen when switching between tasks.Ctrl+D and Ctrl+L?
Git also wins for me. :) php would be second when combining php and sf.
g- git,s- sublimeAre you using self-defined aliases for git or the ones defined by a bash/zsh framework?
I've manually added the following lines in my
.bashrcfile: