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 Answer 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, 2016 at 5:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .