How to enable bash command autocomplete on Alpine Linux

Bash command autocomplete can be enabled on Alpine Linux by installing the bash-completion package and adding the following line to the ~/.bashrc file:

if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
fi

Here are the steps to follow:

  1. Update the package list:
apk update
  1. Install the bash-completion package:
apk add bash-completion
  1. Add the above line to the ~/.bashrc file:
echo "if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
fi"
>> ~/.bashrc
  1. Source the ~/.bashrc file or log out and log back in for the changes to take effect:
source ~/.bashrc

After these steps, bash command autocomplete should be enabled on your Alpine Linux system.

Leave a Comment