Bash completion for Mac OS X

If your are using the Terminal application of your Apple computer running Mac OS X, try bash programmable completion. It allow you to use the TAB key more often, for example in scp: (If you are using ssh-keys.)

$ scp shell01:/etc/pa
/etc/pam.d/         /etc/pam_smb.conf   /etc/passwd
/etc/pam_pkcs11/    /etc/pango/         /etc/passwd-
$ scp shell01:/etc/pa

The steps to start using this great utility are these:

  1. Download the bash programmable completion .tar.gz file.
  2. In a Terminal on your Apple, untar it. (tar -xvf bash-completion-20060301.tar
  3. Copy the bash_completion shell-script to /etc (sudo cp bash_completion/bash_completion /etc)
  4. Add the bash complation to your login script. (echo ". /etc/bash_completion" >> ~/.profile)
  5. Start a new terminal and see the result!