MacOS – Skip first terminal beep and to display ambiguous filename expansions

command linemacosterminal

Pressing TAB in the terminal (and in fact some surprise places in OS X's GUI!) either completes the only filename with the prefix provided to the immediate left of TAB, and when there are several such names (or no such names!) the terminal simply beeps. In the latter case, pressing TAB again either beeps again (because there are no such names at all), or displays a list of the choices.

It seems as though this behaviour introduces ambiguity whereas it seems like the entire point is to prevent ambiguity. I would like to remove the beep that happens when many files with the same prefix exist. It just seems like extra effort and it makes me feel like I did something wrong until I realize that I haven't.

How do I change the behaviour of terminal's TAB completion, specifically to only beep if no such file exist and show possibilities otherwise?

Best Answer

You need to put this line inside ~/.inputrc file:

set show-all-if-ambiguous on

After this You'll get all posssibilities after first ⇥ TAB.