Thursday, February 7, 2013

Enable programmable completion for user

Enable programmable completion for a user:
First install bash-completion package, as root user type

aptitude install bash-completion

and, just add the following lines to the /home/$USER/.bashrc (as $USER)

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

also the root user can have this feature, adding the same lines above in /root/.bashrc

No comments:

Post a Comment