Bash: menu-complete only for few matches

It seems like there is no way.

I know you specifically asked for bash, but in case you want to give zsh a try, it uses ordinary list completion on the first press of tab, and cycles through the possible values on the second press. I think that is very convenient, and switching is a no-brainer as zsh is very similar to bash.


Hit tab twice? Or are you trying to get something like a command then either arg1 or arg2 listed after the command?

ANSWER:

You'll want to edit your /etc/inputrc and add the following line somewhere:

"\C-i": menu-complete 

Then run this command to immediately set your changes:

#: bind -f /etc/inputrc

Unfortunately, I don't see a way to limit it by the number of choices, but that is how you can switch it alternate as you hit the 'tab' key

Reference:independentchaos.com