How to Install and Enable Bash Auto Completion in CentOS/RHEL

Bash (Bourne Again Shell) is undoubtedly the most popular Linux shell out there, no wonder it is the default shell on many Linux distributions. One of its most charming features is the built-in “auto-completion”...

Spread the love

Bash (Bourne Again Shell) is undoubtedly the most popular Linux shell out there, no wonder it is the default shell on many Linux distributions. One of its most charming features is the built-in “auto-completion” support.

Sometimes referred to as TAB completion, this feature permits you to easily complete a command structure. It allows typing a partial command, then pressing the [Tab] key to auto-complete the command and it arguments. It lists all multiple completions, where possible.

Just like Bash, nearly all modern Linux shells ship in with command completion support. In this short guide, we will show you how to turn on the Bash auto-completion feature in CentOS and RHEL systems.

To make working on the command line super easy for you, this is one of the many things you ought to do while performing:

  1. Initial Server Setup and Configurations on RHEL 7
  2. Initial Server Setup and Configurations on CentOS 7


First, you need to enable the EPEL repository on your system, then install the bash-completion package plus some extras using YUM package manager, like this.

# yum install bash-completion bash-completion-extras

Now that you have installed bash completion, you should enable it to start working. First source the bash_completion.sh file. You can use the locate command below to find it:

$ locate bash-completion.sh
$ source /etc/profile.d/bash_completion.sh 
Find and Source Bash-Completion

Find and Source Bash-Completion

Alternatively, logout of your current login current session and re-login.

$ logout 

Now the auto-completion feature should be working on your system, you can try it out as shown below.

$ lo[TAB]
$ ls .bash[TAB]
Check Bash Auto-Completion

Check Bash Auto-Completion

Note: TAB completion works for path names and variables names as well, and it is programmable.

That’s all! In this guide, we showed how to install and enable the Bash auto-completion feature, also known as TAB completion in CentOS/RHEL. You can ask any questions via the comment section below.

Facebook Comments

More Stuff

Piwigo – Create Your Own Photo Gallery Website Piwigo is an open source project which allows you to create your own photo gallery on the web and upload photos and create new albums. The platform in...
How to Create a Favicon for Your Web Site Ever see those little custom icons next to a web site listing in your favorites folder or on your browser address bar? Have you ever wondered how to c...
Netdata – A Real-Time Performance Monitoring Tool for Linux System... netdata is a extremely optimized Linux utility that provides real-time (per second) performance monitoring for Linux systems, applications, SNMP devic...
The FCC’s Net Neutrality Rules Are Dead, but the Fight Isn&#... Federal net neutrality protections are officially dead. Today the Federal Communications Commission's rules barring internet providers from blocking o...
Spread the love

Posted by News Monkey