Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 12 down vote accepted

You can type in the Q key. ...

share|improve this answer
    
...from quit ;) –  Radu Rădeanu Mar 9 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-?

share|improve this answer

Your Answer

 
discard

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.