Upgrade Bash with Bash-It & Ble.sh
1058 words · 6 minutes
For those who are not familiar, Bash is a Unix shell that is used as the default login shell for most Linux distributions. This shell and command proecssor should be familiar if you've used Linux (or older version of macOS) before.
However, bash is not the only option - there are numerous other shells that exist. Here are some popular examples:
While each shell has its differences, bash is POSIX compliant and the default for many Linux users. Because of this, I am going to explore a program called
bash-it below that helps bash users increase the utility of their shell without installing a completely new shell.
First, if bash is not already installed on your system, you can download bash from GNU or use your package manager to install it.
For example, this is how you'd install bash on Fedora Linux:
If you are not using bash as your default shell, use the
chsh command to change your shell:
You should see a prompt like the one below. If the brackets (
bash already, you're done and you can simply continue by hitting the Enter key.
If the brackets contain another shell path (e.g.
/usr/bin/zsh), enter the path to the bash program on your system (it's most likely located at
You must logout or restart the machine in order for the login shell to be refreshed. You can do it now or wait until you're finished customizing the shell.
As noted on the Bash-it repository:
Bash-it is a collection of community Bash commands and scripts for Bash 3.2+. (And a shameless ripoff of oh-my-zsh 😃)
Bash-it makes it easy to install plugins, set up aliases for common commands, and easily change the visual theme of your shell.
To install the framework, simply copy the repository files and use the
install.sh script provided. If you want, you can (and should!) inspect the contents of the installation script before you run it.
If you didn't restart your session after making bash the default, and are currently working within another shell, be sure to enter a bash session before using
Bash-it contains a number of aliases for common commands to help improve efficiency in the terminal. To list all available options, use the following command:
This will provided you a list that looks like the following text block. Within this screen, you will be able to see all available options and which ones are currently enabled.
Alias Enabled? Description ag [ ] the silver searcher (ag) aliases ansible [ ] ansible abbreviations apt [ ] Apt and dpkg aliases for Ubuntu and Debian distros. atom [ ] Atom.io editor abbreviations bash-it [ ] Aliases for the bash-it command (these aliases are automatically included with the "general" aliases) bolt [ ] puppet bolt aliases bundler [ ] ruby bundler clipboard [ ] xclip shortcuts composer [ ] common composer abbreviations curl [x] Curl aliases for convenience. ...
To enable an alias, do:
To disable an alias, do:
Similar to aliases, plugins are available with bash-it. You can find a complete list of plugins in the same way as aliases. Simply execute the following:
You will see the following output showing enabled and disabled plugins:
Plugin Enabled? Description alias-completion [ ] autojump [ ] Autojump configuration, see https://github.com/wting/autojump for more details aws [ ] AWS helper functions base [x] miscellaneous tools basher [ ] initializes basher, the shell package manager battery [x] display info about your battery charge level blesh [ ] load ble.sh, the Bash line editor! boot2docker [ ] Helpers to get Docker setup correctly for boot2docker browser [ ] render commandline output in your browser
To enable a plugin, do:
To disable a plugin, do:
There are quite a few pre-defined themes available with bash-it.
To list all themes:
To use a new theme, you'll need to edit
.bashrc and alter the
BASH_IT_THEME variable to your desired theme. For example, I am using the
Once you save your changes, you just need to exit your terminal and create a new one in order to see your changes to the
.bashrc file. You can also
source the file to see changes, but I recommend starting a completely new shell instead.
One big feature I was missing in Bash that both
fish have is an autosuggestion feature. To explain: as you type, an autosuggestion feature in the shell will offer suggestions in a lighter font color beyond the characters already typed. Once you see the command you want, you can click the right arrow and have the shell auto-complete that line for you.
Luckily, the Bash Line Editor (ble.sh) exists! This program provides a wonderful autosuggestions feature perfectly, among other features that I haven't tested yet.
In order to install ble.sh, execute the following:
Again, exit the terminal and open a new one in order to see the newly-configured shell.
Restart the Session
Finally, as mentioned above, you'll need to restart the session to ensure that your user is using bash by default.
You will also need to exit and re-open a shell (e.g., terminal or terminal tab) any time you make changes to the