How to install and enable Bash auto completion in Fedora Linux

To install and enable Bash auto completion in Fedora Linux, you can use the following steps:

  1. Install the bash-completion package by running the command: sudo dnf install bash-completion
  2. To enable bash-completion for all users, add the following line to the /etc/bashrc file:
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
fi
  1. To enable bash-completion for the current user only, add the same line to the ~/.bashrc file
  2. If you want to enable it only for certain users, add the line to the appropriate user’s ~/.bashrc file
  3. To apply the changes without logging out and logging in again, you can run the following command:
source /etc/bashrc

or

source ~/.bashrc

After this, you will be able to use the tab key to auto complete commands and arguments, making it easier and faster to work with the command line.

Leave a Comment