[plug] enabling advanced bash tab completion

ryan at is.as.geeky.as ryan at is.as.geeky.as
Mon Dec 2 12:50:38 WST 2002


I was just stuffing around as I tend to do and noticed that the true
power of bash completion that I had known existed by looking at
/etc/bash_completion but could never get working except for basic
filename completion, was due to 3 comments in /etc/bash.bashrc (or you
can just execute the /etc/bash_completion script.  It is sooooo obvious
now :P

It seems that is the default in the Debian package - don't know about
other distros.

Take them out, restart a shell and everything magically works :) 
apt-get package completion, ssh hostname completion and all sorts of
useful things.

That might help someone I hope .. I know some of you I spoke to about
this a while back and we were frustrated that the advanced apt-get
completion etc didn't seem to work.  

apt-get install gnome-{tab}{tab} *wait a while for the initial cache to
build*

and even better:

dpkg --purge *letters of choice*{tab}{tab}

Very handy.

Ryan


ryan at slowest:~$ cat /etc/bash.bashrc 
# System-wide .bashrc file for interactive bash(1) shells.

shopt -s checkwinsize

# enable bash completion in interactive shells

# <- remove    if [ "$PS1" -a -f /etc/bash_completion ]; then
# <- remove          . /etc/bash_completion
# <- remove    fi



More information about the plug mailing list