RHEL / CentOS Linux install and activate Bash completion

http‮:s‬//www.lautturi.com
RHEL / CentOS Linux install and activate Bash completion

Bash completion is a feature that allows you to type a partial command and then press the Tab key to automatically complete the command or show a list of options for completing the command.

To install and activate Bash completion on Red Hat Enterprise Linux (RHEL) or CentOS, follow these steps:

  1. Install the bash-completion package using the following command:
sudo yum install bash-completion
  1. Add the following line to your ~/.bashrc file:
source /usr/share/bash-completion/bash_completion

This will enable Bash completion for all users on your system.

  1. If you want to enable Bash completion only for a specific user, add the above line to the user's ~/.bashrc file instead.

  2. To activate Bash completion immediately for the current session, run the following command:

source ~/.bashrc

After completing these steps, Bash completion should be enabled on your system. You can test it by typing a partial command and pressing the Tab key. If Bash completion is working correctly, it should automatically complete the command or show a list of options for completing the command.

Note: If you are using a version of Bash that is older than version 4.0, you may need to install the bash-completion-extras package instead of the bash-completion package. The installation and activation process is the same as described above.

Created Time:2017-10-30 14:27:13  Author:lautturi