Bash completion

Auto-complete symlinked dirs

see readline

Add completion to your own scripts

Put the following command somewhere where it's parsed (e.g. /etc/bash/bashrc.d/my_completion_script.sh, but that also depends on the distro) If your command is my_command and you want to add the options foo, bar and whatever plus all files, use the following command:

complete -f -W "foo bar whatever" my_command

You can also add options this way:

complete -f -W "foo bar whatever --my-option --my-other-option" my_command