In a shell that implements GNU Readline, I can click the key to get a list of possible completions to what I started typing. For example:
C:\>cd P<TAB>
PerfLogs\ Program Files (x86)\ Python27\
Program Files\ ProgramData\How can I now choose which completion I wish to use?
I know that If I want "Program Files" in the above example, I can type in "rogram Files", but I'm lazy :).
Isn't there some way for me to hit a keyboard shortcut that will iterate through the possible completions so I can quickly choose one? Something similar to auto-completion / intellisense in modern IDEs?
Edit: Might my solution be to use GNU Readline's menu-complete command (described below)? But how do I bind it to a key combination?
menu-complete () Similar to complete, but replaces the word to be completed with a single match
from the list of possible completions. Repeated execution of menu-complete steps
through the list of possible completions, inserting each match in turn. At the end of
the list of completions, the bell is rung (subject to the setting of bell-style) and
the original text is restored. An argument of n moves n positions forward in the list
of matches; a negative argument may be used to move backward through the list. This
command is intended to be bound to TAB, but is unbound by default. 2 3 Answers
In a shell that uses readline, you need to bind menu-complete to a key. It is not bound by default, complete is.
To do this, edit ~/.inputrc and add the following:
TAB: menu-completeThis will probably affect all programs that use readline. Use the following to only have this apply to bash:
$if Bash TAB: menu-complete
$endif 5 Command-line completion works in two different ways, depending on platform.
Windows (NT and later)
First of all, the Windows command processor (cmd.exe) does not implement GNU Readline. Despite this, it does support tab-completion.
Specifically, cmd.exe utilizes "rotating completion", where each Tab presents a different option.
In your example, pressing Tab would first give you PerfLogs, then Program Files, etc.
bash (and other Unix shells)
Most Unix shells utilize "prompting completion", where, as Daniel said above, you have to input another character to narrow the completion down.
See this section of the linked-above Wikipedia article for more details.
2Specifically regarding this part of the question
Isn't there some way for me to hit a keyboard shortcut that will iterate through the possible completions so I can quickly choose one? Something similar to auto-completion / intellisense in modern IDEs?
I'd say fzf is what you might want to investigate. Its a pretty fast fuzzy find and selection tool.
1