Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using bash, but I'd like to have zsh style autocomplete (you hit tab and it tabs through the possibilities), rather than what bash seems to do, which is display a list of possibilities but not choose anything until I type some more to disambiguate. How can I get zsh type behavior in bash?

Searching for a solution has turned up lots of answers to other questions, so I'm hoping I can get a simple answer here (i.e. what to paste into my .bashrc).

(And to answer the obvious question, I need to use bash here because I just joined a team and they do some stuff to set up bash to make the environment easier to work in. I can probably eventually make sure I have it working the same way in zsh, but for now it's easier if I use bash and just get it behaving more like zsh during interactive use.)

share|improve this question
up vote 13 down vote accepted

I use

bind 'TAB:menu-complete'

to achieve it

share|improve this answer
When I add this to my .bashrc, tab cycles through the possible options rather than listing them in the terminal. Is is possible to get both behaviors? – Antonios Hadjigeorgalis Aug 17 '14 at 13:08

To get first completion and a listing you can add the following to bashrc

bind 'set show-all-if-ambiguous on'
bind 'TAB:menu-complete'

show-all-if-ambiguous: This alters the default behavior of the completion functions. If set to ‘on’, words which have more than one possible completion cause the matches to be listed immediately instead of ringing the bell. The default value is ‘off’.

see Bash Manual for more information.


This doesn't make bash work exactly as zsh tho. Zsh will complete up until the next ambiguous match. Bash will just cycle through all matches.


$ ls ~/.ba<tab> .bashrc .bash_history .bash_profile

  • zsh: will complete up until ~/.bash and present a list of matches which handily enables you to append _ and hit <tab> again.
  • bash: will just cycle through all ~/.ba* matches.
share|improve this answer
I liked using the arrow keys, and the visual indication of zsh's autocompletion. Is there a way to get those behaviors with bash? I switching back for better server compatibility – CESCO Feb 3 at 22:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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