How to configure bash completion in ubuntu

Thu 11 April 2013 by guglielmo
Filed under howto Tags bash terminal

Working almost always in the terminal of a linux box, the autocompletion feature enhances your speed and comfort, a lot.

Under Ubuntu, autocompletion is installable, if not already installed, with:

apt-get install bash_completion

The ~/.bashrc config file should contain these lines:

if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi

If things are set this way, then you will be able to autocomplete regularly (and save a lot of time).

Note:
In /etc/bash_completion.d you can find the rather cryptic scripts enabling autocomplete patterns inside various unix contexts.

Comments

Fork me on GitHub