I have just came across something that is really bothering me. Autocompletion on ubuntu works like a charm but when I login as root, e.g. su
I get tab
autocompletion only sometimes.
Why does it work like that? Can one change that?
I have just came across something that is really bothering me. Autocompletion on ubuntu works like a charm but when I login as root, e.g. su
I get tab
autocompletion only sometimes.
Why does it work like that? Can one change that?
Check your
/root/.bashrc
file for these linesIf they do not exist add them to the end of the file using your favorite text editor.
You haven't mentioned which Ubuntu version you use.
Check if you have the
bash-completion
package installed:Mine works if I login using:
sudo -i
For Ubuntu 13.10, check
/etc/bash.bashrc
forThey might be commented. Un-commenting them works.
Found that this worked (similar to the answers above but with a twist)
The file that needs to be edited (at least in my case with 12.04) was /root/.bashrc. This makes sense in my case, given that my regular user was autocompleting just fine but my root wasn't.
Anyway in said file I found all the necessary code but it was commented out:
Just un-commented it:
Saved, and it worked just fine.
Hope this helps someone.
In Linux Mint 18 (based on Xenial), you have to edit your bashrc :
and comment out (remove the
#
in front of each line) this section :That’s all.