Installation is easy, type as root
yum install bash-completion
and activate it
source /etc/bashrc
Once you hit "tab" key, completion is more "intelligent", for example:
- It only displays directory with "cd"
- Only displays image files with "display"
- Displays available manual pages with "man"
- Shows mount points with "mount"
- Shows commandline options for the most useful commands, eg. "rpm", "ls", "perl", "mkisofs", etc.
- Displays possible words of dictionary with "look" command
- Recognizes environment variables, aliases and functions
- Can find commandlines and binaries in path within a script (a loop "for", "while", ...)
For example, to add "SVG" extension to "display", edit /etc/bash_completion and change the line ending with display (Vim search: /^complete.*display$) adding "|SVG" within the entries.
To add extensions to "php" command, append
complete -f -X '!*.@(php|php3|php4|php5|phtml|inc)' php
To disable that feature (I don't see a reason to do it), rename the profile file
mv /etc/profile.d/bash_completion.sh{,.bak}