Bash – Is It Possible for Bash Completion to Cycle Through Alternatives?

autocompletebash

When using bash completion and an a number of characters have been entered, tabbing ceases to work when the prefix you have typed is matched by more than one of the possibilities.

Is there a way to cycle through the alternatives of the prefix you have entered?

Best Answer

Bind the Tab key to the menu-complete command instead of the default complete. Put the following line in your ~/.bashrc:

bind '"\C-i": menu-complete'

or the following line in your ~/.inputrc (this will apply to all programs that use the readline library, not just bash):

"\C-i": menu-complete
Related Question