As most people here know, when using bash at the command prompt if you partially type a file name a command or an option to a command etc, bash will complete the word if there is exactly one match.
When there is more than one match, you need to hit <Tab> twice and bash will generate a list of possible matches.
I would like to configure bash to simply provide those options on the first <Tab>.
Is this possible without writing a script? i.e. a shell option?

man bash has a section "programmable completion" but I couldn't make out if there is an option to enable "single tab completion".


Put this in your ~/.inputrc:

set show-all-if-ambiguous on

For additional credit, add:

set completion-ignore-case on

All of the options are in the GNU manual...

  • 3
    Heads up: putting this in your ~/.bash_profile won't work. It has to go in your ~/.inputrc
    – yndolok
    Sep 26 '17 at 19:13
  • 6
    No kidding... That's why I specified placing it there.
    – jasonwryan
    Sep 26 '17 at 19:38

I do not have enough reputation to comment, but I would add to jasonwryans answers that it can be added to .bash_profile or .bashrc by writing them as:

bind 'set show-all-if-ambiguous on'
bind 'set completion-ignore-case on'

I case anybody else finds this question as I did.

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.