I have two files in a directory, test1 and test2. If I type

less te<TAB>

completion kicks in and expands te to test. If I hit TAB a second time nothing happens, and only when I press TAB a third time do I get offered the two matching filenames I might mean.

My question is, why does it take two presses after bash completes as far as it can, before I get offered my choices. Surely it would make more sense to be offered them after the second (in total) of the presses?

  • I agree with you but I don't think it's a big deal. I think it requires the third press to make sure you know there are multiple files that start with the same string. However if you already know that and just want to get it to spit out the names of those files it is annoying.
    – jesse_b
    Jul 18, 2017 at 14:35
  • you can add set show-all-if-ambiguous on to ~/.inputrc to get this behavior
    – Sundeep
    Jul 18, 2017 at 14:58
  • Awesome. Reduces three TABs to one. Just the job. Jul 18, 2017 at 15:02
  • using fish or friendly interactive shell you get many more options for tab completion. May be worth looking into, depending on how much you use it. I find it to be the most usefull environment.
    – Joe
    Jul 19, 2017 at 20:56

1 Answer 1


Add this to ~/.inputrc

set show-all-if-ambiguous on

Quoting from arch wiki on this topic

Or you can set it such that a single tab will perform both steps: partially complete the word and show all possible completions if it is still ambiguous:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .