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!
Discussion
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
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
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 😃
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.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 🤣
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.Here is mine:
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.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:
seems I'm boring, aha
Is sh linked to bash, dash or is it real sh? I wouldn't really see a reason to use sh, even for sh scripts
maybe it's my bad habit, I use
sh xxx.sh
instead of./xxx.sh
My top 20 from
zsh_stats
are:gogogo
is an alias forcode .
, andgc
andga
aregit commit -m
andgit add -A
respectively.Work box:
It's a Mac obviously (
brew
), most of my work done in Visual Studio for Mac. Hence "open" ...open .
so I can open a project file.Funny that ls isn't on there. I guess I know where most of my stuff is? (but not which one is in the path first, hence
which
;P.)Hm. The statistic is realistic, but why my history is so short?...
On my hackintosh, where I've been consistently working on a fairly large-scale adonis application. This is about the output I expected to see, actually...
Likewise on my server where I have ~25 docker containers running various services, no surprises here:
g = alias for git
t = alias for tig
nv = alias for nvim
and zsh_stats says:
gst = git status
This is from when I ssh to my server from windows.
I'm a bit surpriced I don't see anyone else using screen. Though it doesn't look like this includes the commands from inside screen.
For me, these are the top 5. I don't do much on my Ubuntu server.
Someone else using nano!
exit
will be because I'm constantly creating and destroying virtual terminals in GNU screen.ack
is like grep but better.prove
runs my tests.vi
is so far down the list because most of my work is in a single vim that has been running for [looks at process table] three months now.Though this is more representative of which commands I use more uniquely, as I only save new commands into my history, as to not crowd it too much
fortune -o
is one of my ❤ commands. From the man page if anyone is interested:Is fortune the one that posts quotes to your terminal?
Yeah.
Sudo is up there because I just started to really use Ubuntu on my laptop. I had to switch after a windows update borked the system.
by the way i like it, thanks for sharing 👍 👊
I have no idea how python came 3rd 😶
This is from my office PC.
I'll update my laptop's results later.
For those who don't have oh-my-zsh,
z
is a plugin that allows to quickly switch to a directory you've been to andla5
is another plugin (it stands forphp artisan
and comes with autocompletion).fg
is for all the time I suspend nvim to quickly type a command (git push
)New-ish computer, but lots of git going on!
main work is on windows but work on a vagrant vm too
I imagine my
kubectl
usage was insane not too long ago. Probably still goes through spurts where it is at the top.Seeing
kubectl
in my own top 5 and so many others, I am starting to think wether there are some shortcomings in the way we interact with k8s today...Neat:
I don't know what I expected.
I guess mine is pretty standard
1 186 18.6% cd
2 113 11.3% sudo
3 107 10.7% ls
4 101 10.1% clear
5 73 7.3% exit
I guess you use an IDE or don't code (probably the first one)
Yeah I'am mostly on eclipse. I use terminal for server deployments and ant builds mostly. ERP developer on custom java framework :)
Recently, I was doing a Python and a Django tutorial and also reading Obey the testing goat.
seems i am a ls hacker :o
1 1094 27.7032% clear
2 916 23.1957% git
3 406 10.2811% cd
4 293 7.4196% ls
5 190 4.81134% npm
One year of coding produces this.