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'd like for bash to rotate through the matching file names instead of listing them, like the default tab completion behavior in vim. Is there an easy command to do this? This is essentially the opposite of this question.

share|improve this question
up vote 9 down vote accepted

Map Tab to menu-complete.

In your ~/.inputrc:

"\C-i": menu-complete

Re-read the file to make it effective in the current shell by pressing Ctrl-x Ctrl-r.

You can use the following command at a command prompt to enable the feature for the current session if you'd like to test it without editing the ~/.inputrc file, for example.

bind '"\C-i" menu-complete'
share|improve this answer
Is there any way to make SHIFT + TAB go through the list in reverse? – ubiquibacon Jan 7 '14 at 14:58
@ubiquibacon: Generally speaking, in a terminal there's no difference between Tab and Shift + Tab (or other shifted vs. non-shifted control characters). However, you can use another keystroke to do the reverse stepping. bind '"\C-q" "\e-\C-i"' will cause Ctrl + Q to do this (or add "\C-q" "\e-\C-i" to your ~/.inputrc. You may need to add stty -ixon to your ~/.bashrc file to enable Ctrl + Q (and Ctrl + S). The \e- (Escape minus) is what reverses the direction. – Dennis Williamson Jan 7 '14 at 15:47

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.