McFly – Fly through your shell history

This is nothing but a replacement to your Bash search history feature. Most of us use Reverse bash command “Ctrl + R” in order to search and find the most day to day used terminal commands.

Using bash reverse search, as used in most of the Linux distro’s we can bring up all commands which we used previously executed without having to re-type them every time. Other thing is that you may use UP/DOWN arrows to search your bash history. However, Ctrl + R will make this process much easier and faster. Today, I Stumbled upon a replacement to “Ctrl + R” Bash history search feature. Meet “McFly”, a simple tool written in Rust programming language that replaces the default Ctrl + R Bash history search with an intelligent search engine. All command suggestions made by McFly are prioritised in real time with a small neural network.

McFly can be installed using Linuxbrew on Linux. If you haven’t installed Linuxbrew yet, refer this following link.

Once Linuxbrew installed, run the following commands to install McFly:

$ brew tap cantino/mcfly https://github.com/cantino/mcfly
$ brew install mcfly

After the installation is completed, you will see the following output.

==> Installing mcfly from cantino/mcfly
==> Downloading https://github.com/cantino/mcfly/releases/download/v0.2.5/mcfly-v0
==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.c
######################################################################## 100.0%
==> ONE MORE STEP! Edit ~/.bashrc and add the following:

if [ -f $(brew --prefix)/opt/mcfly/mcfly.bash ]; then
. $(brew --prefix)/opt/mcfly/mcfly.bash
fi
 /home/linuxbrew/.linuxbrew/Cellar/mcfly/v0.2.5: 4 files, 3.5MB, built in 33 seconds

As you can see, we need to do one more step before start using McFly.

Add the following lines to your ~/.bashrc file:

if [ -f $(brew --prefix)/opt/mcfly/mcfly.bash ]; then
. $(brew --prefix)/opt/mcfly/mcfly.bash
fi

Finally, run the following command to take effects changes:

$ source ~/.bashrc

Your BASH history will be imported to McFly database when you run this command for the first time. It will take a few moments depending upon size of your bash history file. Once the import is done, you will see the following message.

McFly: Importing Bash history for the first time. This may take a minute or two...done.

Voila ! Now you can now start using McFly, Let’s go…

The below mentioned gif shall give you a fair idea of all what’s it about.(Courtesy:- ostechnix).

Have fun & stay tuned for more good things about Linux !

Akash Angle

I am a Full time Linux user who has quit using Windows for unknown reasons, making my life truly open source.

Recent Posts

Get the most juice from your ISP/router — setting MTU size & other handy tweaks

This is not an ad-vocation by any means for TP-link branding, however a real life…

3 months ago

How to make any Android phone up-to 3x faster – Developer options unleashed

First of all we need to hit the kernel version on any Android device. You…

3 months ago

systemd-resolve command not found in Ubuntu Desktop

Use resolvectl status instead. It's like something deprecates and suddenly things get broken! In systemd…

8 months ago

How to exclude multiple directories with rsync?

Geeky question: This is what people and friends have tried: rsync -arv --exclude "/home/john/.ccache:/home/ben/build" /home/john…

8 months ago

How to resolve apt-get -f not working

You might encounter this error which appears to be very common on Debian based Distro's…

8 months ago

How to install Broadcom STA wireless drivers on Kali Linux

PS: This article is for only Kali Linux users, that too having a Broadcom Wireless…

9 months ago