OSETC TECH

CentOS/RHEL:How To Install BASH Autocomplete Feature

This article will guide you how to install Bash auto complete with YUM command​ on CentOS or RHEL system. How DI Install and use auto complete feature under centos or rhel operating system.

CentOS Bash AutoComplete Feature installation


Type the following command to install bash-completion package on you centos or rhel system:

yum install bash-completion

outputs:

[root@devops Desktop]# yum install bash-completion

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

Resolving Dependencies

--> Running transaction check

---> Package bash-completion.noarch 1:2.1-6.el7 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================

 Package              Arch        Version            Repository

                                                                Size

=====================================================================

Installing:

 bash-completion      noarch      1:2.1-6.el7        base       85 k

Transaction Summary

=====================================================================

Install  1 Package

Total download size: 85 k

Installed size: 259 k

Is this ok [y/d/N]: y

Downloading packages:

bash-completion-2.1-6.el7.noarch.rpm            |  85 kB   00:00     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

Warning: RPMDB altered outside of yum.

** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:

ntp-4.2.6p5-18.el7.centos.x86_64 has missing requires of ntpdate = ('0', '4.2.6p5', '18.el7.centos')

  Installing : 1:bash-completion-2.1-6.el7.noarch                1/1 

  Verifying  : 1:bash-completion-2.1-6.el7.noarch                1/1 

Installed:

  bash-completion.noarch 1:2.1-6.el7                                 

Complete!

Bash Autocomplete Usage

To use bash auto completion feature, you need to press “Tab” key.

For example issuing the “yum re” command, press twice “Tab“, bash-completion script will be execute.

[root@devops Desktop]# yum re [tab] [tab]

reinstall  remove     repolist   

[root@devops Desktop]# yum [tab] [tab]

check             history           remove

check-update      info              repolist

clean             install           search

deplist           list              shell

distro-sync       load-transaction  update

downgrade         makecache         upgrade

groups            provides          version

help              reinstall         

[root@devops Desktop]# yum

done…