Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
30
rated 0 times [  30] [ 0]  / answers: 1 / hits: 15610  / 2 Years ago, thu, june 30, 2022, 4:04:09

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?


More From » 12.04

 Answers
3

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


...to:



if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi


Then close your terminals and reopen them.


[#38073] Thursday, June 30, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
urnaetted

Total Points: 10
Total Questions: 113
Total Answers: 117

Location: Burundi
Member since Sat, Aug 21, 2021
3 Years ago
urnaetted questions
;