Disable Bash's programmable autocompletion (based on command)

Bash in my Fedora 16 seems to autocomplete arguments based on the command itself. So if I for example type

cd Tab

… it will only show directories.

There are however far too many commands where it doesn't know the expected input types, so is there any way to disable this feature?


Solution 1:

Remove the bash-completion package.

Solution 2:

shopt -u progcomp

will disable program based completion and TAB will do regular file/dir completion again. You can do this on a shell by shell basis (or put in in .bashrc for all shell in your account) rather than remove the bash-completion package for everyone. Running complete -r removes all program completion settings so there are none defined. This means if you want to turn it on again you have to redefine them all again. Whereas if you used shopt -u progcomp to turn it off, you can just run shopt -s progcomp to turn it back on again.

Solution 3:

Another way to disable it on a per-user basis is by doing complete -r in your .bashrc file. Type help complete for more information.

Solution 4:

Just removing the package is not enough, you also want to purge the files:

sudo apt-get --purge remove bash-completion