Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

When I am running various commands on the command line in Ubuntu and use tab-completion for files. The only files I am given are ones which have the appropriate extension for the command I am running. For example..

xmms <tab><tab>

would list all the mp3's in the current directory and not any jpegs.

Most of the time this is quite useful. But if the file you want happens to have an incorrect extension, or the extension is valid but the tab completion doesn't think it is then it won't list the file or complete to it. So

  1. Is there a way to turn this feature off (just dumbly complete to any file regardless).
  2. How do you adjust the extensions that are valid for a particular command.



share|improve this question
Same as this:… – MarcH Mar 18 '15 at 19:50
up vote 1 down vote accepted

comment out these lines in /etc/bash.bashrc (it may be in ~/.bashrc):

if [ -f /etc/bash_completion ]; then
 . /etc/bash_completion
share|improve this answer

This is called "Programmable Completion" in bash. Use <tab> to attempt programmable completion, or use M-/ to attempt the default completion (usually files and directories). See also:

share|improve this answer
Thanks for the official name (adding it to question title) – Vagnerr Sep 23 '09 at 16:10
How does this answer the question? – shantnu Oct 8 '14 at 13:21
@shantnu We were young. Mistakes were made. – Annika Backstrom Oct 8 '14 at 18:19

The most elegant way to disable programmable completion should be to add:

shopt -u progcomp

to your .bashrc file. For more details, see the official documentation about the shopt command:

share|improve this answer

To change the completion behaviour, just edit /etc/bash_completion. Scroll down to where you find the list of programs and associated extensions. It should be pretty self-explanatory from there.

share|improve this answer

You must log in to answer this question.

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