In CentOS 8 Linux, you can add bash auto completion by installing the bash-completion
package and enabling it in the .bashrc
file. Here are the steps to set it up:
- Open a terminal window and log in as the root user or use the
sudo
command to run the following commands. - Install the
bash-completion
package by running the following command:
yum install bash-completion
- Edit the
.bashrc
file by running the following command:
vi ~/.bashrc
- Add the following line to the end of the file:
source /etc/bash_completion
- Save and close the file by pressing
Esc
and then:wq
- Reload the
.bashrc
file by running the following command:
source ~/.bashrc
After completing these steps, you should have bash auto completion enabled in your terminal. You can now use the Tab
key to automatically complete commands, file and directory names, and other options.
Please note, you may need to log out and log back in for the changes to take effect.