16

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?

vfclists
  • 7,531
  • 14
  • 53
  • 79

2 Answers2

13

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
6

In bash 4.1 and later you can also use menu-complete-backward to cycle through completions backwards. I have this in my ~/.inputrc:

"\es": menu-complete-backward
"\et": menu-complete
Lri
  • 5,223