I remembered bash can do the following:

Suppose there are 3 files: a,b,c in the current directory, when I input:

$> somecommand *

and then press a key or key combinations or a key sequence, the wildcard * online expanded as:

$> somecommand a b c

but I cannot remember and cannot google out the key sequence! help!


If it is not, you would need to bind glob-expand-word to a key sequence. Typically by by adding something like:

"\C-x*": glob-expand-word

to .inputrc.

To check current status issue something like:

bind -P | grep glob-expand-word

Where result might be:

glob-expand-word can be found on "\C-x*".

Which would mean:


This also most likely work:


Have a look at bind -P and manual(s) for other niceties.


It seems you are looking for list completion. In the man page for bash:

     Set to an integer value corresponding to the type of completion
     attempted  that caused a completion function to be called: TAB,
     for normal completion, ?, for listing completions after succes‐
     sive  tabs, !, for listing alternatives on partial word comple‐
     tion, @, to list completions if the word is not unmodified,  or
     %,  for  menu  completion.   This variable is available only in
     shell functions and external commands invoked by  the  program‐
     mable completion facilities

So it depends on the completion function for somecommand how this is completed.


If you are using set -o vi in bash, then Ctrl-X* doesn't work.

In set -o vi mode you need to use Esc* instead.

  • 1
    It might be worth noting that once you're in normal mode, <C-X>* will work, but the <C-X> is superfluous and does nothing. (<C-X> doesn't decrement as it does in vi.) If you're in insert mode, then you have to use <Esc> first. – wchargin Apr 28 '15 at 4:36
  • This is great. What are these called? bash keyboard shortcuts? Is there some documentation where I can find more of these keyboard shortcuts? – wisbucky Feb 17 '16 at 21:53
  • 1
    @wisbucky: A bit late, but for anyone else, GNU Readline is responsible for these. When you have a slow day, read through the EDITING COMMANDS section of man readline. I've been using Bash for 10 years and I'm still learning new ones. – Soren Bjornstad Apr 30 at 1:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.