I'm on 12.04 and I'm trying to find a way to enable Bash completion in root user.
Any ideas on how to do that?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Bash completion can be enabled in the file .bashrc as explained in this Q&A. In your case it seems to be correct in your user's .bashrc, but not in your root's .bashrc. The latter file is located in
/root/.bashrc. Open this file with your favorite text editor as root (e.g. by running
sudo gedit /root/.bashrc) and remove the
# in the beginning of the last three lines:
You have to change the lines 98-100 from
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then # . /etc/bash_completion #fi
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi
Then close your terminals and reopen them.