Problem:

On my Ubuntu 15.10 laptop I found TAB key completion was not working in the bash shell / terminal.

Solution:

I started by checking the basics;

  • Running echo $SHELL confirmed I was indeed using a bash shell.

Ubuntu - Shell TAB key completion not working

  • Running dpkg -s bash-completion confirmed bash-completion package was installed.

Ubuntu - Shell TAB key completion not working

  • Next I took a look at the /etc/bash.bashrc file and I found the section to “enable bash completion in interactive shells” had been commented out for some reason. It is not something I would have knowingly done, so the reason why the section was commented out is a bit of a mystery. If you have any ideas, please comment.
  • I changed the section from;

  • To;

  • I saved the /etc/bash.bashrc file
  • Closed my current bash shells
  • Opened a new one and tab completion was working fine again.

References:

http://askubuntu.com/questions/33440/tab-completion-doesnt-work-for-commands