If you have MacPorts installed, try this:
sudo port install bash-completion
source /opt/local/etc/bash_completion
There is so much yumminess here that it's hard to know where to begin. Directory commands like pushd will now tab-complete only to directories, user commands like usermod now only complete to usernames, gunzip completes only to files that end in .gz, unalias completes only with current aliases, kill completes with a list of pids, etc., etc., etc. The only danger here is wearing out your tab key.
Obviously, you want to put this in your ~/.profile. Also, since the file takes advantage of features in the latest versions of bash, you may want to sudo port install bash, add /opt/local/bin/bash to /etc/shells, and chsh.
Technorati Tags: OSX, Programming, MacPorts