Ubuntu:
To enable smart completion, edit your /etc/bash.bashrc file. Uncomment the following lines, by removing the # in the beginning of the lines:
#if [ -f /etc/bash_completion ]; then
# . /etc/bash_completion
#fi
Now you can use tab completion to power your way through commands.
http://ubuntu.wordpress.com/2006/01/28/turn-on-bash-smart-completion/
Gentoo:
Now add the following line to /etc/bash/bashrc, before setting any alias (see bug #98627):
| File: /etc/bash/bashrc |
[[ -f /etc/profile.d/bash-completion ]] && source /etc/profile.d/bash-completion |
Let the changes take effect:
# source /etc/bash/bashrc
Or exit the shell and login again.
