Sunday, September 12, 2010

Getting autocompletion to work in a bash terminal on Ubuntu Linux

Been playing around with Ubuntu/Linux for a while now, and my memory of working on HP-UX is slowly awakening.

One thing that has happened lately is that I'm using the terminal (command window in Windows parlance) more and more. And one of the things I've come to use without thinking on Windows is the autocompletion feature in the command window.

By default, autocompletion is switched off on Ubuntu (not sure on other Linux environments). The way to switch it back on is to uncomment the following lines in the bash.bashrc config file:

# enable bash completion in interactive shells
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
#    . /etc/bash_completion
#fi

Restart the terminal window, and voila, autocompletion now works.

No comments:

Post a Comment