Customize BASH shell

Add color prompt, commands autocomplete and aliases for BASH shell

Featured image

1. Switch to root user

I usually create it under root and then replicate to any other users on the system. It’s a matter of preference.

sudo su
cd ~

2. Back up the original files

mv /root/.bashrc /root/.bashrc_bak
mv /root/.inputrc /root/.inputrc_bak
mv /root/.bash_aliases /root/.bash_aliases_bak

Repeat the same for any other user.

3. Download config files

wget https://raw.githubusercontent.com/bgx4k3p/ansible-playbooks/main/custom-configs/bashrc -O /root/.bashrc
wget https://raw.githubusercontent.com/bgx4k3p/ansible-playbooks/main/custom-configs/inputrc -O /root/.inputrc
wget https://raw.githubusercontent.com/bgx4k3p/ansible-playbooks/main/custom-configs/bash_aliases -O /root/.bash_aliases

5. Load configs

source ~/.bashrc

6. Copy the config to other users

cp -f /root/.bashrc /home/bgx4k3p/.bashrc
cp -f /root/.inputrc /home/bgx4k3p/.inputrc

cp -f /root/.bashrc /home/ansible/.bashrc
cp -f /root/.inputrc /home/ansible/.inputrc

7. Fix Permissions

chown ansible:ansible /home/ansible/.bashrc
chown ansible:ansible /home/ansible/.inputrc

chown bgx4k3p:bgx4k3p /home/bgx4k3p/.bashrc
chown bgx4k3p:bgx4k3p /home/bgx4k3p/.inputrc