Disable bash autocompletion on Ubuntu

Some of us old terminal jockeys were annoyed that bash completion was enabled on new Ubuntu installs. Here’s the description for the package:

bash completion extends bash’s standard completion behavior to achieve
complex command lines with just a few keystrokes. This project was
conceived to produce programmable completion routines for the most
common Linux/UNIX commands, reducing the amount of typing sysadmins
and programmers need to do on a daily basis.

The idea is pretty interesting: provide more intelligent tab completions to commands. For example, if you type ‘mysqladmin flush-p<tab>’ it will complete the term ‘flush-privileges’. Very neat.

In practice, those who are quite familiar with tab completion for files and directories may find themselves banging their heads on the tables. One of my fellow programmers was annoyed trying to get filename completion after a perl -d.

Uninstalling Globally

Uninstalling should be as simple as this:

sudo apt-get remove bash-completion

Unfortunately, that still leaves files behind, and hence – not really uninstalled. In fact, if you do a dpkg -l bash-completion, you’ll see it’s in status ‘rc': removal desired, config files remain. Easily fixed:

sudo dpkg --purge bash-completion

Log out and log in, and voila – all gone!

Uninstalling Locally

If you’re sharing the system with other people who do like tab completion, you’re probably better just adding the following to your .bashrc:

complete -r

With no arguments, this will remove all bash completion statements. You could also use that to fine tune what bash completion. This would remove bash completion for emacs, ack, and perl:

complete -r emacs ack ack-grep perl

To verify that it’s removed, try:

complete -p

This prints all completions currently active.

About these ads
Tagged with: ,
Posted in How To
One comment on “Disable bash autocompletion on Ubuntu
  1. […] is no need to uninstall anything, adding complete -r to .bashrc will remove all the completion […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 93 other followers

%d bloggers like this: