In this article, we’ll show you how to fix the broken tab completion feature in the Linux bash console.
On Ubuntu/Debian, you need to install the bash-completion package:
$ sudo apt install bash-completion
If the package is installed, but the autocomplete doesn’t work, reinstall it:
$ sudo apt install --reinstall bash-completion
If the problem persists, check the settings in the bash config file (
Check that the file exists, if the file doesn’t exist, you can copy its template to the user’s home directory:
$ cp /etc/skel/.bashrc ~/
Now open the .bashrc file for editing:
$ sudo nano /root/.bashrc
Check that the following lines are present at the end of the config file:
if ! shopt -oq posix; then if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion elif [ -f /etc/bash_completion ]; then . /etc/bash_completion fi fi
Save the file:
Close your bash session:
Log in again and check that command completion is now working in the Linux CLI.