Linux terminal can't autocomplete

foreword

DD a system, found that the Tab key auto-completion is gone, and found a solution: install bash-completionthe software package

Install

Take aptthe source as an example:

sudo apt update
sudo apt install bash-completion

EDIT .bashrc, see if the following line is enabled, add if not, to load the autocompletion script

if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

Then restart the terminal session, or execute the following command for the changes to take effect:

source ~/.bashrc

After completing the above steps, you should be able to use the auto-completion function in the terminal. Try typing part of the command and pressing Tab, it should autocomplete the command or path

If you are using other shells (such as Zsh), please configure accordingly according to your shell type. Each shell has its own autocompletion configuration method and file

Supongo que te gusta

Origin blog.csdn.net/e5pool/article/details/131099432
Recomendado
Clasificación