I use autocomplete a lot in the terminal, like for example for cp command. But sometimes, when I am putting in the directory for the cp command and I press Tab, the list of files is so long that Ubuntu spits out part of the list and then waits for key input before sequentially listing the rest of the files, one by one. This feature is near useless because you never know how many files are left, and almost always end up with an error.

Is there some way to leave this list and go back to my cp command, or do I have to press Ctrl+C and start typing in my cp command again?

  • @David Bash's tab completion doesn't use a pager. The readline library does this. It just uses the most common pager's keybindings.
    – muru
    Commented Oct 2, 2017 at 9:48

2 Answers 2


You can type in the Q key. ...

  • 2
    ...from quit ;) Commented Mar 9, 2014 at 19:27

This doesn't directly answer your question (@saiarco895 did that), but I hate the default behavior of tab-completion in bash for the same reason. Assuming you're using Bash, you can change the behavior of the readline library it uses by editing the ~/.inputrc file. I put the following in it:

set menu-complete-display-prefix On
"\CTAB": possible-completions
TAB: menu-complete
"\x1b[Z": menu-complete-backward

which allows me to cycle through completion options without printing them out using tab and shift-tab. If I need to see a print-out of all options, I use alt-shift-?

This site is temporarily in read-only mode and not accepting new answers.

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