I never want to see (reverse-i-search) ever again :)

I like learning new stuff - anything, including technology. I love tinkering with new tools, systems and services, especially open source projects
Search for a command to run...

I like learning new stuff - anything, including technology. I love tinkering with new tools, systems and services, especially open source projects
No comments yet. Be the first to comment.
inodes is a concept in Linux. Oh waitβ¦no Fun fact that I learned while experimenting on my macOS - I can see that the term and concept of inodes exists in the context of macOS too Looks like itβs a βUnixβ thing and Linux and Darwin, both are Unix bas...

You can look for Kubernetes Preemption Events in your observability system assuming you are exporting your Kubernetes Events to some store like some time series DB or similar In our case, we use Prometheus and we have an exporter for exporting the Ku...

Recently, when I discovered the py-spy profiler took for Python, I also discovered Speedscope, which is visualization tool for visualizing performance data (performance profile etc). This is a flamegraph Visualization. I have something of this sort w...

So, today, we had an issue in one of our internal systems called API Tester. It was very slow. Only today it was slow, and the CPU usage was very high according to our monitoring systems, especially since today morning. Before noticing the CPU usage,...

If you have Prometheus running and scraping metrics - You can find Kubernetes list of features enabled information for every feature using kubernetes_feature_enabled metric which gives build information kubernetes_feature_enabled{} The name of the f...

Yes, you read that right! I never want to see (reverse-i-search) ever again :) Or anything similar
I use bash shell π and I'm lazy to type out all the commands, especially commands I have typed before. Though I could use my clipboard manager Clipy and copy and keep the commands handy, I think it's too much work to always keep copying commands. I would rather use a search πππ¦π feature to search the old commands and choose the command I want
There are more alternatives too for this, for example, there are tools π§°π οΈβοΈ to help you create aliases for complete commands and search and choose an alias with a quick keyboard shortcut and that will run the whole command :)
What I do? I use a combination of shell history, in my case bash history file and fzf
In my macOS, I simply install fzf and install the key bindings that come with fzf. The installation has become way simpler these days. I just do a single brew install fzf and everything is generally setup. Previously I had to run one more command to install the keybindings
fzf does have documentation ππ on key bindings
https://github.com/junegunn/fzf#key-bindings-for-command-line
What I did? Just brew install fzf in my macOS and ensured that the below line is sourced every time my bash starts off
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
I put this one liner πin my $HOME/.bash_profile which is what gets sourced every time my bash starts off, in my case at least
And the beauty of this? It looks like this now when I do Control + R -

I can do fuzzy search ππ¦ππ too

Look how it selects various commands when my search input is just core abl
It selects corepack enable command and many others too, like -
docker pull core.harbor.domain/blah/something
k get crd -o name | rg coreos | xargs -I{} bash -c "kubectl get {} -o json | jq '.status.conditions[] | select(.type == \"Established\") | .status'"
Notice how it selects part by part, in a fuzzy manner? You can also see why it selected the commands it selected - with a green highlighting/marking/boldening on the letters matching the search input.
The searching happens in a split second - you won't even notice it! It's really fast π¨! I don't have numbers / benchmark tests - maybe you can find it in the fzf project, but they are blazingly fast as they claim :)