logo
Published on Fedora Tunisia (https://fedora-tn.org)

Bash Completion

By Swobodin
Created 2006-05-12 10:40
Bash completion [1] is a collection of shell functions that take advantage of the programmable completion feature of bash 2.04 and later.
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:
Of course, the program is not intelligent to understand what you want to execute, that's why you may modify, add, delete some features.
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}

Source URL:
https://fedora-tn.org/?q=node/98