Lazy System Admins – Bash Completion

Let’s admit it, we’re all lazy system admins. The bash completion in any other distribution is incomplete, and not as powerful as the one in Gentoo. It just does not work the way it works so brilliantly in Gentoo Linux. Ofcourse, you can port that same source to other distributions. To enable bash completion in gentoo, first enable the global flag bash-completion:

euse --enable bash-completion

Now remerge all packages that have that flag:

emerge -avuDN world

You can now see that eselect bashcomp list lists all the completions available, but are not enabled. To enable them all at once, for the current user(in the following, “jude”), do:

mkdir ~/.bash_completion.d
ln -s /usr/share/bash-completion/* ~/.bash_completion.d/

Now disable the following two sets:

eselect bashcomp disable Makefile.am
eselect bashcomp disable Makefile.in

Re-login, and your all set, cheers!