In Red Hat Enterprise Linux 8 (RHEL 8), bash auto-completion can be enabled by installing the “bash-completion” package. Here’s an overview of the steps you’ll need to take:
- Start by installing the “bash-completion” package by running the following command:
sudo dnf install bash-completion
- Once the installation is complete, you can activate the bash completion feature by adding the following line to your “.bashrc” file:
source /usr/share/bash-completion/bash_completion
- Next, reload the “.bashrc” file by running the following command:
source ~/.bashrc
- You should now be able to use the tab key to auto-complete commands and options.
- If you have installed additional software packages that provide command-line utilities, you may need to install the corresponding bash-completion package for those utilities. For example, to enable auto-completion for the “git” command, you would need to install the “git-completion” package.
- To check the list of package providing bash_completion you can use the following command
dnf search bash_completion
By following these steps, you should now have bash auto-completion enabled on your RHEL 8 system. If you encounter any issues or if auto-completion is not working as expected, you may need to check your “.bashrc” file for any errors or conflicts.