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:
[sourcecode lang=bash]
euse –enable bash-completion
[/sourcecode]
Now remerge all packages that have that flag:
[sourcecode lang=bash]
emerge -avuDN world
[/sourcecode]
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:
[sourcecode lang=bash]
mkdir ~/.bash_completion.d
ln -s /usr/share/bash-completion/* ~/.bash_completion.d/
[/sourcecode]
Now disable the following two sets:
[sourcecode lang=bash]
eselect bashcomp disable Makefile.am
eselect bashcomp disable Makefile.in
[/sourcecode]
Re-login, and your all set, cheers!