I start:
1 1874 18.3942% git
2 709 6.95917% sudo
3 622 6.10522% cd
4 565 5.54574% kubectl
5 480 4.71143% docker
I found this nice gem in the-book-of-secret-knowledge. (A good link for any terminal user. Have a look!)
show your top 5 most used commands including their usage %
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 -n 5
(the original was slightly modified to only show the top 5, instead of 20)
I tought it would be fun to share our most used commands here. Show me yours! ;)
❤️ Let's connect!
I would love to grow my network with other tech enthusiasts. Let's connect here or over on twitter! 👋 @langhard
Heads up
I mean I almost don't need to say this, but: Please have a close look at your commands before you share them, don't share private information!
Top comments (98)
This version works for zsh (OSX/oh-my-zsh here):
Use this for easy
zsh_stats
Interesting.. the original version worked fine on osx with zsh for me, this version produces bad output:
For me:
gst: Git status
ras: rails s -b 0.0.0.0
exit: Exiting the terminal :)
gacp: git add . && git ci && git push (I'm lazy)
cd: No need for explanation
Weird. Not what I expected. I guess I use windowed stuff more than I realise.
Sorry to ask, but how are you guys having that dark background on your text 😯
```bash
Text goes here
```
Thanks Matt 😃
The one that's by far most overused (though it won't show up on the list) is the UP arrow. I will shamelessly hit UP 20 times rather than type the simplest command...
Work Computer:
Bosh being our product.
Personal Computer:
As you can tell from the numbers, it's really new (just a few weeks).
connect is an alias for my office's vpn.
re: up arrow
Same
Hmm.., I should use terminal shortcut for clear screen...
I clear my terminal all the time too, but I use cmd + K to do it. Try it out, you might find it easier!
Be lazy and alias "clear" to just "cl" like me 🤣
On my work Mac:
(shore-site is a part of a development environment suite my company uses internally, basically a fancy-pants way of controlling docker instances)
On my nearest VPS:
This stuff is quite hard to compare, because
Vim
and you don't get to see the commands I run from theresudo
Also I'm betting things like
head
andgrep
get used a lot more than this reports but won't show up because they're fed from a pipe.Here is mine:
BTW, if you are wondering what "crea-password.rb" is, it is a script of mine that generates random (but repeatable) passwords. Note also the co-presence of the "competitors" git and bazaar ;-)
I cheated and used Excel because the different commands people shared to get totals didn't take into account command line arguments.
This version work for OSX fish-shell (github.com/fish-shell/fish-shell)
My commands:
Does not appear to work for BASH 5, as I just get a list of dates. I wonder if the author is on macOS, and is using the pre-installed BASH 3.
Changing the
$2
to$4
fixed it for me.list.sh
is a script I wrote to quickly search my calibre library for books in a particular series. e.g.,list.sh Justice League
shows me all the "Justice League" comics I currently have.Also, if
sudo
is in your top 5, then I think there's something wrong with the way you're working. Nobody should needsudo
that much.My tests were on zsh here.
I think you are right about the usage of
sudo
. I made somesudoers
changes after I saw sudo in my own top list. I think for me it was there, because I used it a lot for package updating / installing.Fish shell doesn't seem to record this info :(. I'm pretty sure my top 5 commands would be
git
php
cd
rg (ripgrep)
nvim (neovim)
Edit: Completely forgot
timew
(Time Warrior) I use this constantly for tracking time.For me, these are the top 5. I don't do much on my Ubuntu server.
Someone else using nano!