1

I know that linux bash has autocompletion feature when TAB is pressed and it will show possible completions just below the command. My question is how can you update autocomplete feature so that in addition to showing the list it would also insert the possible completion by subsequent tabs?

For example,

$ sudo apt-[TAB]

would show a list like this:

apt-add-repository, apt-cdrom ,apt-extracttemplates,apt-get

What I want is on next Tab press it should modify the command to:

$ sudo apt-add-repository

On the next Tab press the command would show -

$ sudo apt-cdrom

How to do this?

1

Add TAB: menu-complete line to ~/.inputrc for example with the following command.

echo TAB: menu-complete >> ~/.inputrc

Logout and logon again.

  • Yes. menu-complete iterates through the possible matches but it no longer shows the list of all possible matches. What I want is that on first Tab it would show me a list of all possible matches and on subsequent Tab presses it would iterate through them like menu-complete – Crygnus Mar 19 '16 at 5:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.